Simplify build system for unit tests.
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 9 May 2012 08:11:06 +0000 (11:11 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 9 May 2012 08:37:51 +0000 (11:37 +0300)
- Now that gtest and gmock are build from bundled sources, there should
  be no reason to allow disabling just gmock from the tests (at least
  not strong enough reason compared to the complexity it brings to
  writing the tests and maintaining the build system).
- Make libxml2 mandatory for building any unit tests.  Again,
  simplifies the build system significantly.  Even before this change,
  very few of the unit tests were built without libxml2.

Closes #935.

Change-Id: I8ec5552661860ca43a00d70957fd82d69dcdf739

17 files changed:
CMakeLists.txt
src/CMakeLists.txt
src/external/gmock-1.6.0/CMakeLists.txt
src/gromacs/analysisdata/tests/CMakeLists.txt
src/gromacs/commandline/tests/CMakeLists.txt
src/gromacs/options/tests/CMakeLists.txt
src/gromacs/selection/tests/CMakeLists.txt
src/gromacs/utility/tests/CMakeLists.txt
src/testutils/CMakeLists.txt
src/testutils/TestMacros.cmake
src/testutils/datapath.h
src/testutils/refdata-common.cpp [deleted file]
src/testutils/refdata.cpp
src/testutils/refdata.h
src/testutils/test_main_gtest.cpp [deleted file]
src/testutils/tests/CMakeLists.txt
src/testutils/unittest_main.cpp [moved from src/testutils/test_main_gmock.cpp with 100% similarity]

index 899cba85926d3b076d486dbc5285e9f36a0f8bd9..7bb771ebd6fa42f33fb2bb5c8c21e01e2716fe76 100644 (file)
@@ -509,14 +509,12 @@ else()
           COMPONENT development)
 endif()
 
-option(GMX_USE_GTEST "Build tests that require Google C++ Testing Framework" ON)
-option(GMX_USE_GMOCK "Build tests that require Google C++ Mocking Framework" ON)
-mark_as_advanced(GMX_USE_GTEST)
-mark_as_advanced(GMX_USE_GMOCK)
-if (BUILD_TESTING)
-    add_subdirectory(src/external/gmock-1.6.0)
-    add_custom_target(tests)
-endif (BUILD_TESTING)
+if (LIBXML2_FOUND)
+    option(GMX_BUILD_UNITTESTS "Build unit tests with BUILD_TESTING (uses Google C++ Testing and Mocking Frameworks, requires libxml2)" ON)
+else (LIBXML2_FOUND)
+    set(GMX_BUILD_UNITTESTS OFF)
+endif (LIBXML2_FOUND)
+mark_as_advanced(GMX_BUILD_UNITTESTS)
 set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/cmake/legacy_and_external.supp)
 
 find_package(Doxygen)
index e68d5a5a43bc14eb8f64af61a43e3610c437683e..3988bda34144a9cdd48bd66d0c24de50ca16f943 100644 (file)
@@ -1,8 +1,14 @@
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 
 if (BUILD_TESTING)
+    add_custom_target(tests)
+    if (GMX_BUILD_UNITTESTS)
+        add_subdirectory(external/gmock-1.6.0)
+    endif (GMX_BUILD_UNITTESTS)
     include(testutils/TestMacros.cmake)
-    add_subdirectory(testutils)
+    if (GMX_BUILD_UNITTESTS)
+        add_subdirectory(testutils)
+    endif (GMX_BUILD_UNITTESTS)
 endif (BUILD_TESTING)
 
 add_subdirectory(gromacs)
index a41b37ec1aef6993affba5333dffab340cbe823e..cf8bd6b8dd63c9c18c333cb3ebe7417775748294 100644 (file)
@@ -7,21 +7,13 @@ set(GMOCK_SOURCES ${GMOCK_DIR}/src/gmock-all.cc)
 
 set(GTEST_INCLUDE_DIRS ${GTEST_DIR}/include)
 set(GMOCK_INCLUDE_DIRS ${GMOCK_DIR}/include ${GTEST_INCLUDE_DIRS})
-if (GMX_USE_GMOCK)
-    set(GMX_USE_GTEST ON)
-    include_directories(${GTEST_INCLUDE_DIRS})
-    include_directories(${GTEST_DIR})
-    include_directories(${GMOCK_INCLUDE_DIRS})
-    include_directories(${GMOCK_DIR})
-    add_library(gmock STATIC ${GMOCK_SOURCES} ${GTEST_SOURCES})
-    set(GMOCK_LIBRARIES gmock ${PTHREADS_LIBRARIES} PARENT_SCOPE)
-endif (GMX_USE_GMOCK)
-if (GMX_USE_GTEST)
-    include_directories(${GTEST_INCLUDE_DIRS})
-    include_directories(${GTEST_DIR})
-    add_library(gtest STATIC ${GTEST_SOURCES})
-    set(GTEST_LIBRARIES gtest ${PTHREADS_LIBRARIES} PARENT_SCOPE)
-endif (GMX_USE_GTEST)
-set(GMX_USE_GTEST ${GMX_USE_GTEST} PARENT_SCOPE)
-set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE)
+
+include_directories(${GTEST_INCLUDE_DIRS})
+include_directories(${GTEST_DIR})
+include_directories(${GMOCK_INCLUDE_DIRS})
+include_directories(${GMOCK_DIR})
+add_library(gmock STATIC ${GMOCK_SOURCES} ${GTEST_SOURCES})
+set(GMOCK_LIBRARIES gmock ${PTHREADS_LIBRARIES} PARENT_SCOPE)
+set(GTEST_LIBRARIES ${GMOCK_LIBRARIES} PARENT_SCOPE)
 set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS} PARENT_SCOPE)
+set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE)
index 0bbaba429ae3627b3da7bd55bda19b727b2b5ff3..4b1111ef0b68fc4317a3d8fb5a97764cf32c9e76 100644 (file)
@@ -1,6 +1,7 @@
-if (TESTUTILS_HAVE_REFDATA)
-    add_gmock_test(AnalysisDataUnitTests analysisdata-test
-                   analysisdata.cpp arraydata.cpp
-                   average.cpp datatest.cpp histogram.cpp
-                   mock_module.cpp)
-endif ()
+gmx_add_unit_test(AnalysisDataUnitTests analysisdata-test
+                  analysisdata.cpp
+                  arraydata.cpp
+                  average.cpp
+                  datatest.cpp
+                  histogram.cpp
+                  mock_module.cpp)
index fd5105a83ba23e47b20d0e0a518ca7e1b0b692c5..49b8c32a9b618a7b7c8bd32a3792c1ddae5c33a0 100644 (file)
@@ -1,8 +1,5 @@
-if (TESTUTILS_HAVE_REFDATA)
-    add_gtest_or_gmock_test(CommandLineUnitTests commandline-test
-                            cmdlinehelpwriter.cpp
-                            cmdlineparser.cpp
-                            cmdlinetest.cpp
-                            GMOCK_ONLY
-                            cmdlinemodulemanager.cpp)
-endif ()
+gmx_add_unit_test(CommandLineUnitTests commandline-test
+                  cmdlinehelpwriter.cpp
+                  cmdlinemodulemanager.cpp
+                  cmdlineparser.cpp
+                  cmdlinetest.cpp)
index ca2a9c8b3295930a4941255642befbbf8a1a98a9..808999bece5e7be30365dc58a2b324b245b6174c 100644 (file)
@@ -1,4 +1,5 @@
-add_gtest_or_gmock_test(OptionsUnitTests options-test
-                        option.cpp optionsassigner.cpp
-                        timeunitmanager.cpp
-                        GMOCK_ONLY abstractoptionstorage.cpp)
+gmx_add_unit_test(OptionsUnitTests options-test
+                  abstractoptionstorage.cpp
+                  option.cpp
+                  optionsassigner.cpp
+                  timeunitmanager.cpp)
index ac952bca1799077a4413c90300279df3af977d26..63975d3a94d259baa127eecd8fd85e9ddf30aa73 100644 (file)
@@ -1,4 +1,3 @@
-if (TESTUTILS_HAVE_REFDATA)
-    add_gtest_test(SelectionUnitTests selection-test
-                   selectioncollection.cpp selectionoption.cpp)
-endif ()
+gmx_add_unit_test(SelectionUnitTests selection-test
+                  selectioncollection.cpp
+                  selectionoption.cpp)
index 36afa8ef3b28c5aa3c489381067a7d603e1145af..7afb3d5925bd279c3f53069529d54a149fafa859 100644 (file)
@@ -1,4 +1,2 @@
-if (TESTUTILS_HAVE_REFDATA)
-    add_gtest_test(UtilityUnitTests utility-test
-                   format.cpp)
-endif ()
+gmx_add_unit_test(UtilityUnitTests utility-test
+                  format.cpp)
index 54abcc2a04f7987e7398527b89471f4d6b492595..1b59a872d8889dc2e2d2da3714580b1ccd93d01a 100644 (file)
@@ -1,23 +1,15 @@
-set(TESTUTILS_HAVE_REFDATA FALSE)
-set(COMMON_SOURCES datapath.cpp refdata-common.cpp testoptions.cpp)
-if (GMX_USE_GTEST AND LIBXML2_FOUND)
-    include_directories(${GTEST_INCLUDE_DIRS})
-    list(APPEND COMMON_SOURCES refdata.cpp stringtest.cpp)
-    set(TESTUTILS_HAVE_REFDATA TRUE)
-    add_definitions(-DTESTUTILS_HAVE_REFDATA)
-endif ()
+include_directories(${GTEST_INCLUDE_DIRS})
+set(COMMON_SOURCES datapath.cpp
+                   refdata.cpp
+                   stringtest.cpp
+                   testoptions.cpp)
 
 add_library(testutils STATIC ${COMMON_SOURCES})
-set(TESTUTILS_LIBS testutils)
-target_link_libraries(testutils libgromacs)
-if (TESTUTILS_HAVE_REFDATA)
-    list(APPEND TESTUTILS_LIBS ${GTEST_LIBRARIES} ${LIBXML2_LIBRARIES})
-    target_link_libraries(testutils ${GTEST_LIBRARIES} ${LIBXML2_LIBRARIES})
-endif ()
+set(TESTUTILS_LIBS testutils ${GTEST_LIBRARIES} ${LIBXML2_LIBRARIES})
+target_link_libraries(testutils libgromacs ${GTEST_LIBRARIES} ${LIBXML2_LIBRARIES})
 
 set(TESTUTILS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(TESTUTILS_DIR ${TESTUTILS_DIR} PARENT_SCOPE)
 set(TESTUTILS_LIBS ${TESTUTILS_LIBS} PARENT_SCOPE)
-set(TESTUTILS_HAVE_REFDATA ${TESTUTILS_HAVE_REFDATA} PARENT_SCOPE)
 
 add_subdirectory(tests)
index e54154298279081864d4a9068e7843e5b06de90f..9af5a7aff8ca317e9e032132b3bc9153511f4323 100644 (file)
@@ -1,25 +1,7 @@
-function (add_gtest_test NAME EXENAME)
-    if (GMX_USE_GTEST AND BUILD_TESTING)
-        include_directories(${GTEST_INCLUDE_DIRS})
-        add_executable(${EXENAME} ${ARGN} ${TESTUTILS_DIR}/test_main_gtest.cpp)
-        target_link_libraries(${EXENAME} libgromacs ${TESTUTILS_LIBS} ${GTEST_LIBRARIES})
-        get_target_property(DEFS ${EXENAME} COMPILE_DEFINITIONS)
-        if (NOT DEFS)
-            set(DEFS)
-        endif ()
-        list(APPEND DEFS TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}")
-        set_target_properties(${EXENAME} PROPERTIES COMPILE_DEFINITIONS ${DEFS})
-        add_test(NAME ${NAME}
-                 COMMAND ${EXENAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${EXENAME}.xml)
-        set_tests_properties(${NAME} PROPERTIES LABELS "GTest")
-       add_dependencies(tests ${EXENAME})
-    endif ()
-endfunction ()
-
-function (add_gmock_test NAME EXENAME)
-    if (GMX_USE_GMOCK AND BUILD_TESTING)
+function (gmx_add_unit_test NAME EXENAME)
+    if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
         include_directories(${GMOCK_INCLUDE_DIRS})
-        add_executable(${EXENAME} ${ARGN} ${TESTUTILS_DIR}/test_main_gmock.cpp)
+        add_executable(${EXENAME} ${ARGN} ${TESTUTILS_DIR}/unittest_main.cpp)
         target_link_libraries(${EXENAME} libgromacs ${TESTUTILS_LIBS} ${GMOCK_LIBRARIES})
         get_target_property(DEFS ${EXENAME} COMPILE_DEFINITIONS)
         if (NOT DEFS)
@@ -30,25 +12,6 @@ function (add_gmock_test NAME EXENAME)
         add_test(NAME ${NAME}
                  COMMAND ${EXENAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${EXENAME}.xml)
         set_tests_properties(${NAME} PROPERTIES LABELS "GTest")
-       add_dependencies(tests ${EXENAME})
-    endif ()
-endfunction ()
-
-function (add_gtest_or_gmock_test NAME EXENAME)
-    if (GMX_USE_GTEST AND BUILD_TESTING)
-        set(_outvar GTEST_SOURCES)
-        foreach(_source IN ITEMS ${ARGN})
-            if (_source STREQUAL GMOCK_ONLY)
-                set(_outvar GMOCK_SOURCES)
-            else ()
-                list(APPEND ${_outvar} ${_source})
-            endif ()
-        endforeach()
-        if (GMX_USE_GMOCK)
-            set(SOURCES ${GTEST_SOURCES} ${GMOCK_SOURCES})
-            add_gmock_test(${NAME} ${EXENAME} ${SOURCES})
-        else ()
-            add_gtest_test(${NAME} ${EXENAME} ${GTEST_SOURCES})
-        endif ()
+        add_dependencies(tests ${EXENAME})
     endif ()
 endfunction ()
index 8db826fb8883c531772bb87273fad45ee67fed74..a996e07ab51b5b34751040c6440bf3d2474c18df 100644 (file)
  * \inlibraryapi
  * \ingroup module_testutils
  */
-/*! \libinternal \defgroup module_testutils Unit Testing Utility Modules
+/*! \libinternal \defgroup module_testutils Unit Testing Utilities
  * \brief
  * Common helper classes and functions for writing unit tests.
  *
+ * To build unit tests using these utilities, libxml2 is required.
+ *
  * \ingroup group_utilitymodules
  */
 #ifndef GMX_TESTUTILS_DATAPATH_H
diff --git a/src/testutils/refdata-common.cpp b/src/testutils/refdata-common.cpp
deleted file mode 100644 (file)
index 2a23c48..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
- */
-/*! \internal \file
- * \brief
- * Implements functions in refdata.h that don't have external dependencies.
- *
- * \author Teemu Murtola <teemu.murtola@cbr.su.se>
- * \ingroup module_testutils
- */
-#include "refdata.h"
-
-#include <cstring>
-#include <cstdio>
-
-#include <new>
-
-#include "testutils/datapath.h"
-
-namespace gmx
-{
-namespace test
-{
-
-static ReferenceDataMode g_referenceDataMode = erefdataCompare;
-
-
-ReferenceDataMode getReferenceDataMode()
-{
-    return g_referenceDataMode;
-}
-
-
-void setReferenceDataMode(ReferenceDataMode mode)
-{
-    g_referenceDataMode = mode;
-}
-
-
-std::string getReferenceDataPath()
-{
-    return getTestFilePath("refdata");
-}
-
-
-void initReferenceData(int *argc, char **argv)
-{
-    int i, newi;
-
-    for (i = newi = 1; i < *argc; ++i, ++newi)
-    {
-        argv[newi] = argv[i];
-        if (!std::strcmp(argv[i], "--create-ref-data"))
-        {
-            setReferenceDataMode(erefdataCreateMissing);
-            --newi;
-        }
-        else if (!std::strcmp(argv[i], "--update-ref-data"))
-        {
-            setReferenceDataMode(erefdataUpdateAll);
-            --newi;
-        }
-    }
-    *argc = newi;
-#ifdef TESTUTILS_HAVE_REFDATA
-    try
-    {
-        internal::addGlobalReferenceDataEnvironment();
-    }
-    catch (const std::bad_alloc &)
-    {
-        std::fprintf(stderr, "Out of memory\n");
-        std::exit(1);
-    }
-#endif
-}
-
-} // namespace test
-} // namespace gmx
index 1ac6a543e1e436e72a72132c38e5be6eb0397c67..19c40e10f2d898170c1d5101a3a6e56fb31e7679 100644 (file)
@@ -30,7 +30,7 @@
  */
 /*! \internal \file
  * \brief
- * Implements gmx::test::TestReferenceData.
+ * Implements classes and functions from refdata.h.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_testutils
@@ -39,7 +39,9 @@
 
 #include <cstdio>
 #include <cstdlib>
+#include <cstring>
 
+#include <new>
 #include <string>
 
 #include <gtest/gtest.h>
@@ -50,6 +52,7 @@
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/format.h"
+#include "testutils/datapath.h"
 #include "testutils/testexceptions.h"
 
 #include "refdata-impl.h"
@@ -73,17 +76,52 @@ namespace gmx
 namespace test
 {
 
-/*! \cond internal */
-namespace internal
+static ReferenceDataMode g_referenceDataMode = erefdataCompare;
+
+ReferenceDataMode getReferenceDataMode()
 {
+    return g_referenceDataMode;
+}
+
+void setReferenceDataMode(ReferenceDataMode mode)
+{
+    g_referenceDataMode = mode;
+}
 
-void addGlobalReferenceDataEnvironment()
+std::string getReferenceDataPath()
 {
-    ::testing::AddGlobalTestEnvironment(new TestReferenceDataEnvironment);
+    return getTestFilePath("refdata");
 }
 
-} // namespace internal
-//! \endcond
+void initReferenceData(int *argc, char **argv)
+{
+    int i, newi;
+
+    for (i = newi = 1; i < *argc; ++i, ++newi)
+    {
+        argv[newi] = argv[i];
+        if (!std::strcmp(argv[i], "--create-ref-data"))
+        {
+            setReferenceDataMode(erefdataCreateMissing);
+            --newi;
+        }
+        else if (!std::strcmp(argv[i], "--update-ref-data"))
+        {
+            setReferenceDataMode(erefdataUpdateAll);
+            --newi;
+        }
+    }
+    *argc = newi;
+    try
+    {
+        ::testing::AddGlobalTestEnvironment(new TestReferenceDataEnvironment);
+    }
+    catch (const std::bad_alloc &)
+    {
+        std::fprintf(stderr, "Out of memory\n");
+        std::exit(1);
+    }
+}
 
 /********************************************************************
  * TestReferenceData::Impl
index 522019e2be35b422c9e2cd6007dcf73126a92bb8..96a54e6ddfd8ff7b7d17cbd7627035b788ef3db8 100644 (file)
@@ -113,31 +113,6 @@ std::string getReferenceDataPath();
  */
 void initReferenceData(int *argc, char **argv);
 
-/*! \cond internal */
-/*! \internal \brief
- * Internal testing namespace.
- *
- * This namespace is used to contain some implementation-specific functions and
- * classes.  These are not meant for direct access, but typically reside in
- * visible headers because of implementation reasons.
- */
-namespace internal
-{
-
-/*! \internal \brief
- * Adds a global test teardown method for freeing libxml2 internal data.
- *
- * This method is called by initReferenceData(), and should not be called
- * directly.
- * It adds a global test environment object that calls xmlCleanupParser() at
- * the end of all tests.  This makes memory reports from valgrind cleaner since
- * otherwise they show the memory as "still reachable".
- */
-void addGlobalReferenceDataEnvironment();
-
-} // namespace internal
-//! \endcond
-
 
 class TestReferenceChecker;
 
@@ -181,10 +156,6 @@ TEST(MyTest, SimpleTest)
  * reference data file is not reported as an error, nor is empty reference data
  * file created in write mode).
  *
- * This class is only available if both Google Test and libxml2 are enabled.
- * If either one is missing, trying to use this class will result in unresolved
- * symbols in linking.
- *
  * \inlibraryapi
  * \ingroup module_testutils
  */
@@ -245,10 +216,6 @@ class TestReferenceData
  *
  * Copies of this class behave have independent internal state.
  *
- * This class is only available if both Google Test and libxml2 are enabled.
- * If either one is missing, trying to use this class will result in unresolved
- * symbols in linking.
- *
  * \inlibraryapi
  * \ingroup module_testutils
  */
diff --git a/src/testutils/test_main_gtest.cpp b/src/testutils/test_main_gtest.cpp
deleted file mode 100644 (file)
index 5ad85d3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
- */
-/*! \libinternal \file
- * \brief
- * main() for unit tests that use Google C++ Testing Framework.
- *
- * \author Teemu Murtola <teemu.murtola@cbr.su.se>
- * \ingroup module_testutils
- */
-#include <gtest/gtest.h>
-
-#include "testutils/testoptions.h"
-
-#ifndef TEST_DATA_PATH
-//! Path to test input data directory (needs to be set by the build system).
-#define TEST_DATA_PATH 0
-#endif
-
-/*! \brief
- * Initializes unit testing with Google C++ Testing Framework.
- */
-int main(int argc, char *argv[])
-{
-    ::testing::InitGoogleTest(&argc, argv);
-    ::gmx::test::initTestUtils(TEST_DATA_PATH, &argc, argv);
-    return RUN_ALL_TESTS();
-}
index 52d1f2abe24230c507ba8ad51223c8f495030a5d..09e58cc65ede762cef4b192fa4ba1cef8a8cea59 100644 (file)
@@ -1,4 +1,2 @@
-if (TESTUTILS_HAVE_REFDATA)
-    add_gtest_test(TestUtilsUnitTests testutils-test
-                   refdata.cpp)
-endif (TESTUTILS_HAVE_REFDATA)
+gmx_add_unit_test(TestUtilsUnitTests testutils-test
+                  refdata.cpp)