From fcec94579c3bb825e3b45bf0b468d167ea57c857 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jul 2020 17:21:51 -0400 Subject: [PATCH] skip tests for single and extract when testing kspace styles (and pair styles are disabled) --- unittest/force-styles/pair_style.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/unittest/force-styles/pair_style.cpp b/unittest/force-styles/pair_style.cpp index 5f55c78b95..f3a9325ae8 100644 --- a/unittest/force-styles/pair_style.cpp +++ b/unittest/force-styles/pair_style.cpp @@ -1050,6 +1050,14 @@ TEST(PairStyle, single) GTEST_SKIP(); } + if (!pair->compute_flag) { + std::cerr << "Pair style disabled" << std::endl; + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + GTEST_SKIP(); + } + // The single function in EAM is different from what we assume // here, therefore we have to skip testing those pair styles. if ((test_config.pair_style.substr(0, 3) == "eam") || @@ -1265,7 +1273,16 @@ TEST(PairStyle, extract) } GTEST_SKIP(); } + Pair *pair = lmp->force->pair; + if (!pair->compute_flag) { + std::cerr << "Pair style disabled" << std::endl; + if (!verbose) ::testing::internal::CaptureStdout(); + cleanup_lammps(lmp, test_config); + if (!verbose) ::testing::internal::GetCapturedStdout(); + GTEST_SKIP(); + } + void *ptr = nullptr; int dim = 0; for (auto &extract : test_config.extract) {