Disable analysisdata generic tests if not compilable
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 8 Aug 2014 04:07:19 +0000 (07:07 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 16 Aug 2014 23:29:16 +0000 (01:29 +0200)
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

index 6a7a5bc48316238186b23a986f96bd227e74f42c..9149a5177c616217ae0b55feff00651d27a53ca7 100644 (file)
@@ -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