From 0b0ebf2bce21b9ce728522d1239e1f45a88d6b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sat, 17 Aug 2019 13:57:24 +0300 Subject: [PATCH] Start modifying the tests structure. Former-commit-id: 2e95b72fb3258fddd75a3b9c2ab23aa53b0a9d9a --- CMakeLists.txt | 3 + {tests => oldtests}/Amaxcumsum.c | 0 {tests => oldtests}/Bmaxcumsum.c | 0 .../besselDJcases.REMOVED.git-id | 0 .../besselDYcases.REMOVED.git-id | 0 .../besselJcases.REMOVED.git-id | 0 .../besselYcases.REMOVED.git-id | 0 .../bessel_precision/besseltest.c | 0 .../bessel_precision/besseltest_orig.c | 0 .../bessel_precision/compileall.sh | 0 .../bessel_precision/sagebesselgen.py | 0 {tests => oldtests}/bspectransl.c | 0 {tests => oldtests}/c_Mie_tmatrices.py | 0 {tests => oldtests}/cruzan_A.m | 0 {tests => oldtests}/cruzan_B.m | 0 .../cytmatrices_consistence.py | 0 {tests => oldtests}/ewalds.c | 0 {tests => oldtests}/ewaldshift.c | 0 {tests => oldtests}/ewaldshift2.c | 0 {tests => oldtests}/ewaldshift3g_vargeom.c | 0 {tests => oldtests}/ewaldshift_3g.c | 0 {tests => oldtests}/ewaldshift_ng.c | 0 {tests => oldtests}/fixproj-notes | 0 {tests => oldtests}/gauntgen.m | 0 {tests => oldtests}/gauntgenbare.m | 0 {tests => oldtests}/gauntmaxcumsum.c | 0 {tests => oldtests}/generate_groupcode.py | 0 {tests => oldtests}/gsl-intgamma/ewald2F2.c | 0 .../gsl-intgamma/genvals-incgamma.py | 0 .../gsl-intgamma/genvals-quadratures.py | 0 {tests => oldtests}/gsl-intgamma/incgamma.c | 0 .../gsl-intgamma/incgamma.mathematica | 0 .../gsl-intgamma/quad.mathematica | 0 .../gsl-intgamma/quadratures.c | 0 .../gsl-intgamma/values.in.REMOVED.git-id | 0 .../gsl-intgamma/values2.in.REMOVED.git-id | 0 {tests => oldtests}/gsl_leg_phase.c | 0 {tests => oldtests}/interptest.py | 0 {tests => oldtests}/lattice/2d_3lat_rcount.c | 0 .../lattice/2d_triangular_lattice.c | 0 .../modeproblem_implementations.py | 0 {tests => oldtests}/pointgrouptest.py | 0 {tests => oldtests}/quaternion_O3.c | 0 {tests => oldtests}/scatsys.py | 0 {tests => oldtests}/ss_syms_packs.c | 0 {tests => oldtests}/sss1.c | 0 {tests => oldtests}/sss2.c | 0 {tests => oldtests}/sss3.c | 0 {tests => oldtests}/sss4.c | 0 {tests => oldtests}/staticgroups.c | 0 {tests => oldtests}/staticgroups.h | 0 {tests => oldtests}/test_latticegens.c | 0 {tests => oldtests}/test_latticegenxyweb.c | 0 {tests => oldtests}/test_lattices2d.c | 0 {tests => oldtests}/test_qpms_p.py | 0 {tests => oldtests}/tmatrixgens.py | 0 {tests => oldtests}/transcoeff_cruzan.py | 0 tests/CMakeLists.txt | 8 +++ .../tests => tests}/test_vswf_translations.c | 12 ++-- .../test_vswf_translations_array.c | 55 +++++++++---------- 60 files changed, 42 insertions(+), 36 deletions(-) rename {tests => oldtests}/Amaxcumsum.c (100%) rename {tests => oldtests}/Bmaxcumsum.c (100%) rename {tests => oldtests}/bessel_precision/besselDJcases.REMOVED.git-id (100%) rename {tests => oldtests}/bessel_precision/besselDYcases.REMOVED.git-id (100%) rename {tests => oldtests}/bessel_precision/besselJcases.REMOVED.git-id (100%) rename {tests => oldtests}/bessel_precision/besselYcases.REMOVED.git-id (100%) rename {tests => oldtests}/bessel_precision/besseltest.c (100%) rename {tests => oldtests}/bessel_precision/besseltest_orig.c (100%) rename {tests => oldtests}/bessel_precision/compileall.sh (100%) rename {tests => oldtests}/bessel_precision/sagebesselgen.py (100%) rename {tests => oldtests}/bspectransl.c (100%) rename {tests => oldtests}/c_Mie_tmatrices.py (100%) rename {tests => oldtests}/cruzan_A.m (100%) rename {tests => oldtests}/cruzan_B.m (100%) rename {tests => oldtests}/cytmatrices_consistence.py (100%) rename {tests => oldtests}/ewalds.c (100%) rename {tests => oldtests}/ewaldshift.c (100%) rename {tests => oldtests}/ewaldshift2.c (100%) rename {tests => oldtests}/ewaldshift3g_vargeom.c (100%) rename {tests => oldtests}/ewaldshift_3g.c (100%) rename {tests => oldtests}/ewaldshift_ng.c (100%) rename {tests => oldtests}/fixproj-notes (100%) rename {tests => oldtests}/gauntgen.m (100%) rename {tests => oldtests}/gauntgenbare.m (100%) rename {tests => oldtests}/gauntmaxcumsum.c (100%) rename {tests => oldtests}/generate_groupcode.py (100%) rename {tests => oldtests}/gsl-intgamma/ewald2F2.c (100%) rename {tests => oldtests}/gsl-intgamma/genvals-incgamma.py (100%) rename {tests => oldtests}/gsl-intgamma/genvals-quadratures.py (100%) rename {tests => oldtests}/gsl-intgamma/incgamma.c (100%) rename {tests => oldtests}/gsl-intgamma/incgamma.mathematica (100%) rename {tests => oldtests}/gsl-intgamma/quad.mathematica (100%) rename {tests => oldtests}/gsl-intgamma/quadratures.c (100%) rename {tests => oldtests}/gsl-intgamma/values.in.REMOVED.git-id (100%) rename {tests => oldtests}/gsl-intgamma/values2.in.REMOVED.git-id (100%) rename {tests => oldtests}/gsl_leg_phase.c (100%) rename {tests => oldtests}/interptest.py (100%) rename {tests => oldtests}/lattice/2d_3lat_rcount.c (100%) rename {tests => oldtests}/lattice/2d_triangular_lattice.c (100%) rename {tests => oldtests}/modeproblem_implementations.py (100%) rename {tests => oldtests}/pointgrouptest.py (100%) rename {tests => oldtests}/quaternion_O3.c (100%) rename {tests => oldtests}/scatsys.py (100%) rename {tests => oldtests}/ss_syms_packs.c (100%) rename {tests => oldtests}/sss1.c (100%) rename {tests => oldtests}/sss2.c (100%) rename {tests => oldtests}/sss3.c (100%) rename {tests => oldtests}/sss4.c (100%) rename {tests => oldtests}/staticgroups.c (100%) rename {tests => oldtests}/staticgroups.h (100%) rename {tests => oldtests}/test_latticegens.c (100%) rename {tests => oldtests}/test_latticegenxyweb.c (100%) rename {tests => oldtests}/test_lattices2d.c (100%) rename {tests => oldtests}/test_qpms_p.py (100%) rename {tests => oldtests}/tmatrixgens.py (100%) rename {tests => oldtests}/transcoeff_cruzan.py (100%) create mode 100644 tests/CMakeLists.txt rename {qpms/tests => tests}/test_vswf_translations.c (96%) rename {qpms/tests => tests}/test_vswf_translations_array.c (91%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54a44c1..e3e7eeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,4 +29,7 @@ cmake_add_fortran_subdirectory (amos LIBRARIES amos NO_EXTERNAL_INSTALL) add_subdirectory (qpms) + +add_subdirectory (tests) + #add_subdirectory (apps/transop-ewald) diff --git a/tests/Amaxcumsum.c b/oldtests/Amaxcumsum.c similarity index 100% rename from tests/Amaxcumsum.c rename to oldtests/Amaxcumsum.c diff --git a/tests/Bmaxcumsum.c b/oldtests/Bmaxcumsum.c similarity index 100% rename from tests/Bmaxcumsum.c rename to oldtests/Bmaxcumsum.c diff --git a/tests/bessel_precision/besselDJcases.REMOVED.git-id b/oldtests/bessel_precision/besselDJcases.REMOVED.git-id similarity index 100% rename from tests/bessel_precision/besselDJcases.REMOVED.git-id rename to oldtests/bessel_precision/besselDJcases.REMOVED.git-id diff --git a/tests/bessel_precision/besselDYcases.REMOVED.git-id b/oldtests/bessel_precision/besselDYcases.REMOVED.git-id similarity index 100% rename from tests/bessel_precision/besselDYcases.REMOVED.git-id rename to oldtests/bessel_precision/besselDYcases.REMOVED.git-id diff --git a/tests/bessel_precision/besselJcases.REMOVED.git-id b/oldtests/bessel_precision/besselJcases.REMOVED.git-id similarity index 100% rename from tests/bessel_precision/besselJcases.REMOVED.git-id rename to oldtests/bessel_precision/besselJcases.REMOVED.git-id diff --git a/tests/bessel_precision/besselYcases.REMOVED.git-id b/oldtests/bessel_precision/besselYcases.REMOVED.git-id similarity index 100% rename from tests/bessel_precision/besselYcases.REMOVED.git-id rename to oldtests/bessel_precision/besselYcases.REMOVED.git-id diff --git a/tests/bessel_precision/besseltest.c b/oldtests/bessel_precision/besseltest.c similarity index 100% rename from tests/bessel_precision/besseltest.c rename to oldtests/bessel_precision/besseltest.c diff --git a/tests/bessel_precision/besseltest_orig.c b/oldtests/bessel_precision/besseltest_orig.c similarity index 100% rename from tests/bessel_precision/besseltest_orig.c rename to oldtests/bessel_precision/besseltest_orig.c diff --git a/tests/bessel_precision/compileall.sh b/oldtests/bessel_precision/compileall.sh similarity index 100% rename from tests/bessel_precision/compileall.sh rename to oldtests/bessel_precision/compileall.sh diff --git a/tests/bessel_precision/sagebesselgen.py b/oldtests/bessel_precision/sagebesselgen.py similarity index 100% rename from tests/bessel_precision/sagebesselgen.py rename to oldtests/bessel_precision/sagebesselgen.py diff --git a/tests/bspectransl.c b/oldtests/bspectransl.c similarity index 100% rename from tests/bspectransl.c rename to oldtests/bspectransl.c diff --git a/tests/c_Mie_tmatrices.py b/oldtests/c_Mie_tmatrices.py similarity index 100% rename from tests/c_Mie_tmatrices.py rename to oldtests/c_Mie_tmatrices.py diff --git a/tests/cruzan_A.m b/oldtests/cruzan_A.m similarity index 100% rename from tests/cruzan_A.m rename to oldtests/cruzan_A.m diff --git a/tests/cruzan_B.m b/oldtests/cruzan_B.m similarity index 100% rename from tests/cruzan_B.m rename to oldtests/cruzan_B.m diff --git a/tests/cytmatrices_consistence.py b/oldtests/cytmatrices_consistence.py similarity index 100% rename from tests/cytmatrices_consistence.py rename to oldtests/cytmatrices_consistence.py diff --git a/tests/ewalds.c b/oldtests/ewalds.c similarity index 100% rename from tests/ewalds.c rename to oldtests/ewalds.c diff --git a/tests/ewaldshift.c b/oldtests/ewaldshift.c similarity index 100% rename from tests/ewaldshift.c rename to oldtests/ewaldshift.c diff --git a/tests/ewaldshift2.c b/oldtests/ewaldshift2.c similarity index 100% rename from tests/ewaldshift2.c rename to oldtests/ewaldshift2.c diff --git a/tests/ewaldshift3g_vargeom.c b/oldtests/ewaldshift3g_vargeom.c similarity index 100% rename from tests/ewaldshift3g_vargeom.c rename to oldtests/ewaldshift3g_vargeom.c diff --git a/tests/ewaldshift_3g.c b/oldtests/ewaldshift_3g.c similarity index 100% rename from tests/ewaldshift_3g.c rename to oldtests/ewaldshift_3g.c diff --git a/tests/ewaldshift_ng.c b/oldtests/ewaldshift_ng.c similarity index 100% rename from tests/ewaldshift_ng.c rename to oldtests/ewaldshift_ng.c diff --git a/tests/fixproj-notes b/oldtests/fixproj-notes similarity index 100% rename from tests/fixproj-notes rename to oldtests/fixproj-notes diff --git a/tests/gauntgen.m b/oldtests/gauntgen.m similarity index 100% rename from tests/gauntgen.m rename to oldtests/gauntgen.m diff --git a/tests/gauntgenbare.m b/oldtests/gauntgenbare.m similarity index 100% rename from tests/gauntgenbare.m rename to oldtests/gauntgenbare.m diff --git a/tests/gauntmaxcumsum.c b/oldtests/gauntmaxcumsum.c similarity index 100% rename from tests/gauntmaxcumsum.c rename to oldtests/gauntmaxcumsum.c diff --git a/tests/generate_groupcode.py b/oldtests/generate_groupcode.py similarity index 100% rename from tests/generate_groupcode.py rename to oldtests/generate_groupcode.py diff --git a/tests/gsl-intgamma/ewald2F2.c b/oldtests/gsl-intgamma/ewald2F2.c similarity index 100% rename from tests/gsl-intgamma/ewald2F2.c rename to oldtests/gsl-intgamma/ewald2F2.c diff --git a/tests/gsl-intgamma/genvals-incgamma.py b/oldtests/gsl-intgamma/genvals-incgamma.py similarity index 100% rename from tests/gsl-intgamma/genvals-incgamma.py rename to oldtests/gsl-intgamma/genvals-incgamma.py diff --git a/tests/gsl-intgamma/genvals-quadratures.py b/oldtests/gsl-intgamma/genvals-quadratures.py similarity index 100% rename from tests/gsl-intgamma/genvals-quadratures.py rename to oldtests/gsl-intgamma/genvals-quadratures.py diff --git a/tests/gsl-intgamma/incgamma.c b/oldtests/gsl-intgamma/incgamma.c similarity index 100% rename from tests/gsl-intgamma/incgamma.c rename to oldtests/gsl-intgamma/incgamma.c diff --git a/tests/gsl-intgamma/incgamma.mathematica b/oldtests/gsl-intgamma/incgamma.mathematica similarity index 100% rename from tests/gsl-intgamma/incgamma.mathematica rename to oldtests/gsl-intgamma/incgamma.mathematica diff --git a/tests/gsl-intgamma/quad.mathematica b/oldtests/gsl-intgamma/quad.mathematica similarity index 100% rename from tests/gsl-intgamma/quad.mathematica rename to oldtests/gsl-intgamma/quad.mathematica diff --git a/tests/gsl-intgamma/quadratures.c b/oldtests/gsl-intgamma/quadratures.c similarity index 100% rename from tests/gsl-intgamma/quadratures.c rename to oldtests/gsl-intgamma/quadratures.c diff --git a/tests/gsl-intgamma/values.in.REMOVED.git-id b/oldtests/gsl-intgamma/values.in.REMOVED.git-id similarity index 100% rename from tests/gsl-intgamma/values.in.REMOVED.git-id rename to oldtests/gsl-intgamma/values.in.REMOVED.git-id diff --git a/tests/gsl-intgamma/values2.in.REMOVED.git-id b/oldtests/gsl-intgamma/values2.in.REMOVED.git-id similarity index 100% rename from tests/gsl-intgamma/values2.in.REMOVED.git-id rename to oldtests/gsl-intgamma/values2.in.REMOVED.git-id diff --git a/tests/gsl_leg_phase.c b/oldtests/gsl_leg_phase.c similarity index 100% rename from tests/gsl_leg_phase.c rename to oldtests/gsl_leg_phase.c diff --git a/tests/interptest.py b/oldtests/interptest.py similarity index 100% rename from tests/interptest.py rename to oldtests/interptest.py diff --git a/tests/lattice/2d_3lat_rcount.c b/oldtests/lattice/2d_3lat_rcount.c similarity index 100% rename from tests/lattice/2d_3lat_rcount.c rename to oldtests/lattice/2d_3lat_rcount.c diff --git a/tests/lattice/2d_triangular_lattice.c b/oldtests/lattice/2d_triangular_lattice.c similarity index 100% rename from tests/lattice/2d_triangular_lattice.c rename to oldtests/lattice/2d_triangular_lattice.c diff --git a/tests/modeproblem_implementations.py b/oldtests/modeproblem_implementations.py similarity index 100% rename from tests/modeproblem_implementations.py rename to oldtests/modeproblem_implementations.py diff --git a/tests/pointgrouptest.py b/oldtests/pointgrouptest.py similarity index 100% rename from tests/pointgrouptest.py rename to oldtests/pointgrouptest.py diff --git a/tests/quaternion_O3.c b/oldtests/quaternion_O3.c similarity index 100% rename from tests/quaternion_O3.c rename to oldtests/quaternion_O3.c diff --git a/tests/scatsys.py b/oldtests/scatsys.py similarity index 100% rename from tests/scatsys.py rename to oldtests/scatsys.py diff --git a/tests/ss_syms_packs.c b/oldtests/ss_syms_packs.c similarity index 100% rename from tests/ss_syms_packs.c rename to oldtests/ss_syms_packs.c diff --git a/tests/sss1.c b/oldtests/sss1.c similarity index 100% rename from tests/sss1.c rename to oldtests/sss1.c diff --git a/tests/sss2.c b/oldtests/sss2.c similarity index 100% rename from tests/sss2.c rename to oldtests/sss2.c diff --git a/tests/sss3.c b/oldtests/sss3.c similarity index 100% rename from tests/sss3.c rename to oldtests/sss3.c diff --git a/tests/sss4.c b/oldtests/sss4.c similarity index 100% rename from tests/sss4.c rename to oldtests/sss4.c diff --git a/tests/staticgroups.c b/oldtests/staticgroups.c similarity index 100% rename from tests/staticgroups.c rename to oldtests/staticgroups.c diff --git a/tests/staticgroups.h b/oldtests/staticgroups.h similarity index 100% rename from tests/staticgroups.h rename to oldtests/staticgroups.h diff --git a/tests/test_latticegens.c b/oldtests/test_latticegens.c similarity index 100% rename from tests/test_latticegens.c rename to oldtests/test_latticegens.c diff --git a/tests/test_latticegenxyweb.c b/oldtests/test_latticegenxyweb.c similarity index 100% rename from tests/test_latticegenxyweb.c rename to oldtests/test_latticegenxyweb.c diff --git a/tests/test_lattices2d.c b/oldtests/test_lattices2d.c similarity index 100% rename from tests/test_lattices2d.c rename to oldtests/test_lattices2d.c diff --git a/tests/test_qpms_p.py b/oldtests/test_qpms_p.py similarity index 100% rename from tests/test_qpms_p.py rename to oldtests/test_qpms_p.py diff --git a/tests/tmatrixgens.py b/oldtests/tmatrixgens.py similarity index 100% rename from tests/tmatrixgens.py rename to oldtests/tmatrixgens.py diff --git a/tests/transcoeff_cruzan.py b/oldtests/transcoeff_cruzan.py similarity index 100% rename from tests/transcoeff_cruzan.py rename to oldtests/transcoeff_cruzan.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..c9210d5 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,8 @@ + +add_executable( test_vswf_translations_array test_vswf_translations_array.c ) +target_link_libraries( test_vswf_translations_array qpms gsl blas lapacke amos m ) +target_include_directories ( test_vswf_translations_array PRIVATE .. ) + +add_executable( test_vswf_translations test_vswf_translations.c ) +target_link_libraries( test_vswf_translations qpms gsl blas lapacke amos m ) +target_include_directories ( test_vswf_translations PRIVATE .. ) diff --git a/qpms/tests/test_vswf_translations.c b/tests/test_vswf_translations.c similarity index 96% rename from qpms/tests/test_vswf_translations.c rename to tests/test_vswf_translations.c index 0072ecf..dc77b5d 100644 --- a/qpms/tests/test_vswf_translations.c +++ b/tests/test_vswf_translations.c @@ -1,14 +1,14 @@ -//c99 -o test_vswf_translations -ggdb -I ../../amos -I .. test_vswf_translations.c ../translations.c ../gaunt.c -lgsl -lm -lblas ../vecprint.c ../vswf.c ../legendre.c ../error.c ../bessel.c ../../amos/libamos.a -lgfortran -#include "translations.h" -#include "vswf.h" +//c99 -o test_vswf_translations -ggdb -I .. test_vswf_translations.c -lqpms -lgsl -lm -lblas +#include +#include #include #include #include #include #include -#include "vectors.h" -#include "string.h" -#include "indexing.h" +#include +#include +#include char *normstr(qpms_normalisation_t norm) { //int csphase = qpms_normalisation_t_csphase(norm); diff --git a/qpms/tests/test_vswf_translations_array.c b/tests/test_vswf_translations_array.c similarity index 91% rename from qpms/tests/test_vswf_translations_array.c rename to tests/test_vswf_translations_array.c index 1d8c047..f330a49 100644 --- a/qpms/tests/test_vswf_translations_array.c +++ b/tests/test_vswf_translations_array.c @@ -1,29 +1,25 @@ -//c99 -o test_vswf_translations_array -ggdb -I .. test_vswf_translations_array.c ../translations.c ../gaunt.c -lgsl -lm -lblas ../vecprint.c ../vswf.c ../legendre.c -#include "translations.h" -#include "vswf.h" +//c99 -o test_vswf_translations_array -ggdb -I .. test_vswf_translations_array.c -lqpms -lgsl -lm -lblas +#include +#include #include #include #include #include #include -#include "vectors.h" -#include "string.h" -#include "indexing.h" +#include +#include +#include char *normstr(qpms_normalisation_t norm) { //int csphase = qpms_normalisation_t_csphase(norm); - norm = qpms_normalisation_t_normonly(norm); + norm = norm & QPMS_NORMALISATION_NORM_BITS; switch (norm) { - case QPMS_NORMALISATION_NONE: + case QPMS_NORMALISATION_NORM_NONE: return "none"; - case QPMS_NORMALISATION_SPHARM: + case QPMS_NORMALISATION_NORM_SPHARM: return "spharm"; - case QPMS_NORMALISATION_POWER: + case QPMS_NORMALISATION_NORM_POWER: return "power"; -#ifdef USE_XU_ANTINORMALISATION - case QPMS_NORMALISATION_XU: - return "xu"; -#endif default: return "!!!undef!!!"; } @@ -60,23 +56,22 @@ int main() { w->y = gsl_ran_gaussian(rng, sigma); w->z = gsl_ran_gaussian(rng, sigma); } - - for(int use_csbit = 0; use_csbit <= 1; ++use_csbit) { - for(int i = 1; -#ifdef USE_XU_ANTINORMALISATION - i <= 4; -#else - i <= 3; -#endif - ++i){ - qpms_normalisation_t norm = i | (use_csbit ? QPMS_NORMALISATION_T_CSBIT : 0); - qpms_trans_calculator *c = qpms_trans_calculator_init(lMax, norm); - for(int J = 1; J <= 4; ++J) - test_sphwave_translation(c, J, o2minuso1, npoints, points); - qpms_trans_calculator_free(c); - } - } + for(int use_csbit = 0; use_csbit <= 1; ++use_csbit) { + for(int i = 0; i < 3; ++i){ + qpms_normalisation_t norm = ((qpms_normalisation_t[]) + { QPMS_NORMALISATION_NORM_SPHARM, + QPMS_NORMALISATION_NORM_POWER, + QPMS_NORMALISATION_NORM_NONE + })[i] + | (use_csbit ? QPMS_NORMALISATION_CSPHASE : 0); + qpms_trans_calculator *c = qpms_trans_calculator_init(lMax, norm); + for(int J = 1; J <= 4; ++J) + test_sphwave_translation(c, J, o2minuso1, npoints, points); + qpms_trans_calculator_free(c); + } + + } gsl_rng_free(rng); }