From 4e92c6824416993ddd46902ba03e1f1b6f5ecf2e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Sep 2021 23:41:31 -0400 Subject: [PATCH] allow skipping fix timestep tests when LAMMPS was compiled for static libs --- unittest/force-styles/CMakeLists.txt | 3 +++ unittest/force-styles/test_fix_timestep.cpp | 6 ++++++ .../force-styles/tests/fix-timestep-python_move_nve.yaml | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index fba632d3ec..5e0b677042 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -117,6 +117,9 @@ endforeach() # tester for timestepping fixes add_executable(test_fix_timestep test_fix_timestep.cpp) +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(test_fix_timestep -DUSING_STATIC_LIBS=1) +endif() target_link_libraries(test_fix_timestep PRIVATE lammps style_tests) # tests for timestep related fixes (time integration, thermostat, force manipulation, constraints/restraints) diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp index 362a632713..ac83ff9573 100644 --- a/unittest/force-styles/test_fix_timestep.cpp +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -255,6 +255,9 @@ TEST(FixTimestep, plain) { if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); +#if defined(USING_STATIC_LIBS) + if (test_config.skip_tests.count("static")) GTEST_SKIP(); +#endif const char *args[] = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite"}; @@ -703,6 +706,9 @@ TEST(FixTimestep, omp) if (!LAMMPS::is_installed_pkg("OPENMP")) GTEST_SKIP(); if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); +#if defined(USING_STATIC_LIBS) + if (test_config.skip_tests.count("static")) GTEST_SKIP(); +#endif const char *args[] = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite", "-pk", "omp", "4", "-sf", "omp"}; diff --git a/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml b/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml index 9c78dbe416..04bd81670b 100644 --- a/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml +++ b/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml @@ -1,6 +1,7 @@ --- lammps_version: 10 Mar 2021 -date_generated: Wed Mar 24 18:57:26 202 +date_generated: Wed Mar 24 18:57:26 2021 +skip_tests: static epsilon: 9e-12 prerequisites: ! | atom full