From 5ab7482e2e51aa3df1bc95f1b934d784a014a1ad Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Fri, 8 Aug 2014 07:07:19 +0300 Subject: [PATCH] Disable analysisdata generic tests if not compilable If Google Test claims that typed tests are not supported, exclude the analysisdata generic tests that use this functionality from compilation (since they wouldn't compile). Instead, add a dummy test that at least shows a developer who runs the unit test executable directly that something is missing (the ctest run still passes without any messages). Change-Id: Iba9bcc4b993e5213fe48e24d52b09474e5801fa8 --- src/gromacs/analysisdata/tests/analysisdata.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gromacs/analysisdata/tests/analysisdata.cpp b/src/gromacs/analysisdata/tests/analysisdata.cpp index 6a7a5bc483..9149a5177c 100644 --- a/src/gromacs/analysisdata/tests/analysisdata.cpp +++ b/src/gromacs/analysisdata/tests/analysisdata.cpp @@ -139,6 +139,7 @@ TEST(AnalysisDataInitializationTest, ChecksMultipointModules) EXPECT_NO_THROW_GMX(data.addModule(mod2)); } +#if GTEST_HAS_TYPED_TEST /******************************************************************** * Input data for tests below. @@ -446,4 +447,19 @@ TYPED_TEST(AnalysisDataCommonTest, LimitedStorageWorks) ASSERT_NO_THROW_GMX(AnalysisDataTest::presentAllData()); } +#else + +/* A dummy test that at least signals that something is missing if one runs the + * unit test executable itself. + */ +TEST(DISABLED_AnalysisDataCommonTest, GenericTests) +{ + ADD_FAILURE() + << "Tests for generic AnalysisData functionality require support for " + << "Google Test typed tests, which was not available when the tests " + << "were compiled."; +} + +#endif + } // namespace -- 2.22.0