Separate the testutils module.
authorM. Eric Irrgang <mei2n@virginia.edu>
Tue, 17 Nov 2020 16:53:02 +0000 (16:53 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 17 Nov 2020 16:53:02 +0000 (16:53 +0000)
Create `testutils` target and separate public/private headers.
Remove `src/` from global build tree include path.

Apply some tidying demanded by clang-tidy.

Ref #3288

53 files changed:
CMakeLists.txt
src/gromacs/trajectoryanalysis/tests/CMakeLists.txt
src/programs/CMakeLists.txt
src/testutils/CMakeLists.txt
src/testutils/TestMacros.cmake
src/testutils/cmdlinetest.cpp
src/testutils/conftest.cpp
src/testutils/filematchers.cpp
src/testutils/include/testutils/cmdlinetest.h [moved from src/testutils/cmdlinetest.h with 100% similarity]
src/testutils/include/testutils/conftest.h [moved from src/testutils/conftest.h with 97% similarity]
src/testutils/include/testutils/filematchers.h [moved from src/testutils/filematchers.h with 98% similarity]
src/testutils/include/testutils/interactivetest.h [moved from src/testutils/interactivetest.h with 98% similarity]
src/testutils/include/testutils/loggertest.h [moved from src/testutils/loggertest.h with 97% similarity]
src/testutils/include/testutils/mpitest.h [moved from src/testutils/mpitest.h with 98% similarity]
src/testutils/include/testutils/refdata.h [moved from src/testutils/refdata.h with 100% similarity]
src/testutils/include/testutils/setenv.h [moved from src/testutils/setenv.h with 97% similarity]
src/testutils/include/testutils/simulationdatabase.h [moved from src/testutils/simulationdatabase.h with 98% similarity]
src/testutils/include/testutils/stdiohelper.h [moved from src/testutils/stdiohelper.h with 97% similarity]
src/testutils/include/testutils/stringtest.h [moved from src/testutils/stringtest.h with 97% similarity]
src/testutils/include/testutils/test_device.h [moved from src/testutils/test_device.h with 100% similarity]
src/testutils/include/testutils/test_hardware_environment.h [moved from src/testutils/test_hardware_environment.h with 100% similarity]
src/testutils/include/testutils/testasserts.h [moved from src/testutils/testasserts.h with 100% similarity]
src/testutils/include/testutils/testexceptions.h [moved from src/testutils/testexceptions.h with 97% similarity]
src/testutils/include/testutils/testfilemanager.h [moved from src/testutils/testfilemanager.h with 100% similarity]
src/testutils/include/testutils/testfileredirector.h [moved from src/testutils/testfileredirector.h with 98% similarity]
src/testutils/include/testutils/testinit.h [moved from src/testutils/testinit.h with 100% similarity]
src/testutils/include/testutils/testmatchers.h [moved from src/testutils/testmatchers.h with 100% similarity]
src/testutils/include/testutils/testoptions.h [moved from src/testutils/testoptions.h with 100% similarity]
src/testutils/include/testutils/textblockmatchers.h [moved from src/testutils/textblockmatchers.h with 98% similarity]
src/testutils/include/testutils/tprfilegenerator.h [moved from src/testutils/tprfilegenerator.h with 97% similarity]
src/testutils/include/testutils/xvgtest.h [moved from src/testutils/xvgtest.h with 98% similarity]
src/testutils/interactivetest.cpp
src/testutils/loggertest.cpp
src/testutils/mpitest.cpp
src/testutils/refdata.cpp
src/testutils/refdata_checkers.h
src/testutils/refdata_xml.cpp
src/testutils/refdata_xml.h
src/testutils/simulationdatabase.cpp
src/testutils/stdiohelper.cpp
src/testutils/stringtest.cpp
src/testutils/test_device.cpp
src/testutils/test_hardware_environment.cpp
src/testutils/testasserts.cpp
src/testutils/testfilemanager.cpp
src/testutils/testfileredirector.cpp
src/testutils/testinit.cpp
src/testutils/testmatchers.cpp
src/testutils/testoptions.cpp
src/testutils/tests/CMakeLists.txt
src/testutils/textblockmatchers.cpp
src/testutils/tprfilegenerator.cpp
src/testutils/xvgtest.cpp

index 8884423152cf62d73bc2096ae1f33778bf293c74..945cacd0c9ec6fa879afeefa200e8b93ccd7fa85 100644 (file)
@@ -602,10 +602,7 @@ gmx_add_cache_dependency(GMX_BUILD_UNITTESTS BOOL BUILD_TESTING OFF)
 # Our own GROMACS tests
 ########################################################################
 
-include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src)
 include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/src/external)
-# Required for config.h, maybe should only be set in src/CMakeLists.txt
-include_directories(BEFORE ${CMAKE_BINARY_DIR}/src)
 
 include(gmxTestInlineASM)
 gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
index 20c5b9386eaa9498f76acae0f33eb840339a92f8..ec69fddd66cf2d7fcede23fed5cbb70329d17082 100644 (file)
@@ -59,5 +59,9 @@ target_link_libraries(trajectoryanalysis-test PRIVATE analysisdata-test-shared)
 target_link_libraries(trajectoryanalysis-test PRIVATE common)
 
 add_executable(test_selection ${UNITTEST_TARGET_OPTIONS} test_selection.cpp)
+target_link_libraries(test_selection PRIVATE
+                      common
+                      libgromacs
+                      ${GMX_EXE_LINKER_FLAGS})
 # TODO: Explicitly link to module dependencies.
-target_link_libraries(test_selection PRIVATE common libgromacs legacy_modules ${GMX_EXE_LINKER_FLAGS})
+target_link_libraries(test_selection PRIVATE legacy_modules)
index 1b29eb711b6517b1baa10f2c8a6e6e9d5a030912..f1209b75aa1b251348c187559b0699cf1370e8a1 100644 (file)
@@ -44,7 +44,7 @@ target_include_directories(mdrun_objlib SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src
 target_link_libraries(mdrun_objlib PRIVATE common)
 target_link_libraries(mdrun_objlib PRIVATE legacy_api)
 # TODO: Explicitly link specific modules.
-target_link_libraries(mdrun_objlib PRIVATE common legacy_modules)
+target_link_libraries(mdrun_objlib PRIVATE legacy_modules)
 
 if(GMX_FAHCORE)
     # The lack of a real source file here alongside the object library
@@ -95,8 +95,8 @@ else()
     gmx_target_compile_options(gmx)
     target_compile_definitions(gmx PRIVATE HAVE_CONFIG_H)
     target_link_libraries(gmx PRIVATE
-                          libgromacs
                           common
+                          libgromacs
                           ${GMX_COMMON_LIBRARIES}
                           ${GMX_EXE_LINKER_FLAGS})
     if(GMX_X11)
index 8b4c6f16b286a492ab1345913e963d980b0f0b36..fa52d3c8403a55ba1dca08fb1b2dfc812b833f7d 100644 (file)
@@ -38,42 +38,12 @@ if (NOT GMX_BUILD_UNITTESTS)
     return()
 endif()
 
-set(TESTUTILS_SOURCES
-    cmdlinetest.cpp
-    conftest.cpp
-    filematchers.cpp
-    interactivetest.cpp
-    loggertest.cpp
-    mpi_printer.cpp
-    mpitest.cpp
-    refdata.cpp
-    refdata_xml.cpp
-    simulationdatabase.cpp
-    stdiohelper.cpp
-    stringtest.cpp
-    testasserts.cpp
-    testfilemanager.cpp
-    testfileredirector.cpp
-    test_device.cpp
-    test_hardware_environment.cpp
-    testinit.cpp
-    testmatchers.cpp
-    testoptions.cpp
-    textblockmatchers.cpp
-    tprfilegenerator.cpp
-    xvgtest.cpp
-    )
-
-if(NOT HAVE_TINYXML2)
-    list(APPEND TESTUTILS_SOURCES ../external/tinyxml2/tinyxml2.cpp)
-endif()
-
 if (GMX_GPU_CUDA)
     # Work around FindCUDA that prevents using target_link_libraries()
     # with keywords otherwise...
     set(CUDA_LIBRARIES PRIVATE ${CUDA_LIBRARIES})
     if (NOT GMX_CLANG_CUDA)
-        gmx_cuda_add_library(testutils ${TESTUTILS_SOURCES})
+        gmx_cuda_add_library(testutils)
     else()
         set_source_files_properties(test_device.cpp PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ)
         gmx_compile_cuda_file_with_clang(test_device.cpp)
@@ -82,10 +52,53 @@ if (GMX_GPU_CUDA)
     endif()
     target_link_libraries(testutils PRIVATE ${CUDA_CUFFT_LIBRARIES})
 else()
-    add_library(testutils STATIC ${UNITTEST_TARGET_OPTIONS} ${TESTUTILS_SOURCES})
+    add_library(testutils STATIC ${UNITTEST_TARGET_OPTIONS})
+endif()
+
+# Module interface / provided facilities
+target_include_directories(testutils PUBLIC include)
+
+# Executable targets for tests based on `testutils` acquire the source for
+# their entry point from unittest_main.cpp when linking to the `testutils` target.
+target_sources(testutils INTERFACE unittest_main.cpp)
+
+
+target_sources(testutils PRIVATE
+               cmdlinetest.cpp
+               conftest.cpp
+               filematchers.cpp
+               interactivetest.cpp
+               loggertest.cpp
+               mpi_printer.cpp
+               mpitest.cpp
+               refdata.cpp
+               refdata_xml.cpp
+               simulationdatabase.cpp
+               stdiohelper.cpp
+               stringtest.cpp
+               testasserts.cpp
+               testfilemanager.cpp
+               testfileredirector.cpp
+               test_device.cpp
+               test_hardware_environment.cpp
+               testinit.cpp
+               testmatchers.cpp
+               testoptions.cpp
+               textblockmatchers.cpp
+               tprfilegenerator.cpp
+               xvgtest.cpp
+               )
+
+
+if(HAVE_TINYXML2)
+    target_include_directories(testutils SYSTEM PRIVATE ${TinyXML2_INCLUDE_DIR})
+    target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+else()
+    target_include_directories(testutils SYSTEM BEFORE PRIVATE ${CMAKE_SOURCE_DIR}/src/external/tinyxml2)
+    target_sources(testutils PRIVATE ${CMAKE_SOURCE_DIR}/src/external/tinyxml2/tinyxml2.cpp)
 endif()
-# TODO: Use a non-degenerate interface include directory.
-target_include_directories(testutils PUBLIC ${CMAKE_SOURCE_DIR}/src)
+
+target_include_directories(testutils PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 
 if (GMX_GPU_SYCL)
     set_source_files_properties(test_device.cpp
@@ -98,12 +111,10 @@ target_include_directories(testutils SYSTEM BEFORE PRIVATE ${PROJECT_SOURCE_DIR}
 target_link_libraries(testutils PRIVATE libgromacs ${GMX_COMMON_LIBRARIES} gmock)
 target_link_libraries(testutils PUBLIC common)
 
-if(HAVE_TINYXML2)
-    include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
-    target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
-else()
-    include_directories(BEFORE SYSTEM "../external/tinyxml2")
-endif()
+# GROMACS module dependencies.
+# Note that testutils conveys transitive dependencies on some modules.
+# TODO: Explicitly link specific modules with minimal exposure.
+target_link_libraries(testutils PUBLIC legacy_modules)
 
 # TODO Use gmx_add_missing_tests_notice() instead of the messages below.
 set(GMX_CAN_RUN_MPI_TESTS 1)
@@ -131,8 +142,6 @@ elseif (NOT GMX_THREAD_MPI)
     set(GMX_CAN_RUN_MPI_TESTS 0)
 endif()
 
-set(TESTUTILS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(TESTUTILS_DIR ${TESTUTILS_DIR} PARENT_SCOPE)
 set(GMX_CAN_RUN_MPI_TESTS ${GMX_CAN_RUN_MPI_TESTS} PARENT_SCOPE)
 
 add_subdirectory(tests)
index e5c4c33190a20a0464a4b0535d031f72e5b740eb..5f29e65402c3fa165fbd912982ad04b8282f775b 100644 (file)
@@ -119,12 +119,10 @@ function (gmx_add_gtest_executable EXENAME)
             cuda_add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS}
                 ${ARG_CPP_SOURCE_FILES}
                 ${ARG_CUDA_CU_SOURCE_FILES}
-                ${ARG_GPU_CPP_SOURCE_FILES}
-                ${TESTUTILS_DIR}/unittest_main.cpp)
+                ${ARG_GPU_CPP_SOURCE_FILES})
         else()
             add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS}
-                ${ARG_CPP_SOURCE_FILES}
-                ${TESTUTILS_DIR}/unittest_main.cpp)
+                ${ARG_CPP_SOURCE_FILES})
         endif()
 
         if (GMX_GPU_CUDA)
index 1c6bdc0f9f8b1b20f53199be6e238e7cc35305f8..9746d3ba511b95aeba2165f2e4df0796cd66e8b8 100644 (file)
@@ -42,7 +42,7 @@
  */
 #include "gmxpre.h"
 
-#include "cmdlinetest.h"
+#include "testutils/cmdlinetest.h"
 
 #include <cstdlib>
 #include <cstring>
index e7be0564a97ceff73cb746090844407eaa296f8a..3fd50276cbfc93c058bef27e6c502842c4c94ca5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "conftest.h"
+#include "testutils/conftest.h"
 
 #include <cstdio>
 #include <cstdlib>
index d836f4e6fcb3fc04a4b68e0e2ffcab2aaec3c890..a312dddd0ff6fd2eb701680a8523d431a9462f16 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "filematchers.h"
+#include "testutils/filematchers.h"
 
 #include "gromacs/utility/filestream.h"
 
similarity index 97%
rename from src/testutils/conftest.h
rename to src/testutils/include/testutils/conftest.h
index c8c7c14dc3be41a80878c79cffc1a114bbb8191c..d22033c53790bfc697fb2293077da3e9863bb1ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/filematchers.h
rename to src/testutils/include/testutils/filematchers.h
index 84201794a5b460982f407f8c60fdbe1077dbc502..921d44709fe0399faa21030da065e6e647a6e76d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/interactivetest.h
rename to src/testutils/include/testutils/interactivetest.h
index 6e0e279deb1ab12dd74746735c56d3699f3cea0b..eeed955928995881ca73ae714b25b0102679f44e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 97%
rename from src/testutils/loggertest.h
rename to src/testutils/include/testutils/loggertest.h
index 5fe63949ce5fc3bfabbf6b342ca84d1333d7af6d..29c5ee5335726c7ff2ab0f09a1bc0ee63cb79d6d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/mpitest.h
rename to src/testutils/include/testutils/mpitest.h
index dbb640a9336ea975cc080a8072ea57af5d410679..e769fbfa907679ad38f3d1ddbf24e48a97136020 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 97%
rename from src/testutils/setenv.h
rename to src/testutils/include/testutils/setenv.h
index 588d93f921793cad7b9419ce8e1294c3b98bc170..fc577ee3d45ad81ea6625945dc51ab38d8edb9ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/simulationdatabase.h
rename to src/testutils/include/testutils/simulationdatabase.h
index 11b1e428d9701a96b8f3cb3da35f4753aca0c9dc..04f89b0a468137d187bbadeedabd03b33da126a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 97%
rename from src/testutils/stdiohelper.h
rename to src/testutils/include/testutils/stdiohelper.h
index 6cb8b68947ebe466906c5be3e95d490809013209..c46df9bf5fd53bab15b4d188f256995fcdf664cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 97%
rename from src/testutils/stringtest.h
rename to src/testutils/include/testutils/stringtest.h
index edf09974a114e239f027c10f8eeb26256844cce3..597078d536cf291b61d0c1596d826acddbfc22dc 100644 (file)
@@ -120,7 +120,7 @@ public:
      * \param[in] refFilename   File with the expected contents.
      * \param[in] testFilename  File with the contents to be tested.
      */
-    void testFilesEqual(const std::string& refFilename, const std::string& testFilename);
+    static void testFilesEqual(const std::string& refFilename, const std::string& testFilename);
 
 private:
     class Impl;
similarity index 97%
rename from src/testutils/testexceptions.h
rename to src/testutils/include/testutils/testexceptions.h
index edbdd6b6fa4cda9c4e87ba6558e9d6c391d807b1..86ea316a942165ab724d3a2df3c9c98b1e92cdc3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2015,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/testfileredirector.h
rename to src/testutils/include/testutils/testfileredirector.h
index 5e34af133bcf9d67c134d17bfc55fe152ebb551c..19dfa499f4ce5d94b7f6b6d07b10a7847b0d756b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/textblockmatchers.h
rename to src/testutils/include/testutils/textblockmatchers.h
index 6eb6be88e9f4b4b4ed641e233caf63ec5ce775b7..67cb5b95bbe5057c8818ebca3206a09b81ce45c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 97%
rename from src/testutils/tprfilegenerator.h
rename to src/testutils/include/testutils/tprfilegenerator.h
index 2073eccfd6945a61bd89be84bd8aa740f9f9ad84..ece2bfe3fac071bd7e250f3f95bf427ac180fa7d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 98%
rename from src/testutils/xvgtest.h
rename to src/testutils/include/testutils/xvgtest.h
index 1812cc328d61bb2a571e94b7a32d30f6efc6d56b..5783fff1ed56e1db527f23180b8085388fafc7f1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 897a01660ec9c16a99e8d0e7dde20b32ab1559c5..e28dbd751df4fefd94e9fecadfdd6475f02db40d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "interactivetest.h"
+#include "testutils/interactivetest.h"
 
 #include <string>
 #include <utility>
index c090c3b2f75dded5864d2e2beec0bf7e8e25c4e1..c534f3c0a93a2cda1790f178dc13f9d6df1eccb3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "loggertest.h"
+#include "testutils/loggertest.h"
 
 #include <gmock/gmock.h>
 
index 63b04b9ce69fcd4dbbfb78dd8bb609d9f3a6d3c4..7c11477f541dcaf2ef0fff9572371db5be562e0d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "mpitest.h"
+#include "testutils/mpitest.h"
 
 #include "config.h"
 
index 8c92d6754f5e4256d2bdd0ab53dee71690222523..6f44673a64e1e7c77eed24e133557b4ba39db988 100644 (file)
@@ -42,7 +42,7 @@
  */
 #include "gmxpre.h"
 
-#include "refdata.h"
+#include "testutils/refdata.h"
 
 #include <cctype>
 #include <cstdlib>
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "testutils/refdata_checkers.h"
-#include "testutils/refdata_impl.h"
-#include "testutils/refdata_xml.h"
 #include "testutils/testasserts.h"
 #include "testutils/testexceptions.h"
 #include "testutils/testfilemanager.h"
 
+#include "refdata_checkers.h"
+#include "refdata_impl.h"
+#include "refdata_xml.h"
+
 namespace gmx
 {
 namespace test
index f8c69f791a6cfd1a522fbb31d58db16b4fabda63..9b5c7c2faa7dfe6b1eab4bae2981a53f44a34607 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/utility/strconvert.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "testutils/refdata_impl.h"
 #include "testutils/testasserts.h"
 #include "testutils/testexceptions.h"
 
+#include "refdata_impl.h"
+
 namespace gmx
 {
 namespace test
index 4d2a71775ddbd7bea4f2d174f7e285dab4fae515..aa8dac17b89669599fdfd4373891d0488873fc67 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "gromacs/utility/exceptions.h"
 
-#include "testutils/refdata_impl.h"
 #include "testutils/testexceptions.h"
 
+#include "refdata_impl.h"
+
 namespace gmx
 {
 namespace test
index d2a9707ccf9c9b84c361a996259b7e32c821698b..546d87903fe39f5bf6619dbd72af6ff08cae767f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,7 +44,7 @@
 
 #include <string>
 
-#include "testutils/refdata_impl.h"
+#include "refdata_impl.h"
 
 namespace gmx
 {
index b8edf036824a120219559e9e2d0e56fb2cd85f1b..52d866f2582ca173079a2809069cea16ed5d6018 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "simulationdatabase.h"
+#include "testutils/simulationdatabase.h"
 
 #include <algorithm>
 #include <map>
index 4afb9ba460474ca45a246152c50a7e6713697177..8bceb0c9238b0741a5a030e66ed8b1075354f7bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "stdiohelper.h"
+#include "testutils/stdiohelper.h"
 
 #include <cerrno>
 #include <cstdio>
index 452c300435d9ae72e4d1a0c3e385a282dccf1e1d..4e5e8b0ae2927fb709b110fa4fa735d4f2720975 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "stringtest.h"
+#include "testutils/stringtest.h"
 
 #include <string>
 
index 8d3865eee0a8920e4588a631230cfa175cf5a544..6865e949845440dfb00e00f478dea368f5290e13 100644 (file)
@@ -43,7 +43,7 @@
  */
 #include "gmxpre.h"
 
-#include "test_device.h"
+#include "testutils/test_device.h"
 
 #include <memory>
 
index 267c73cf27b927af5b3c6b0c520cc377784e8b65..da352962e1a6101822d85d5ec49d87268c1fae09 100644 (file)
@@ -44,7 +44,7 @@
 
 #include "gmxpre.h"
 
-#include "test_hardware_environment.h"
+#include "testutils/test_hardware_environment.h"
 
 #include <memory>
 
index acf173cd957aa2a762d83e1fdbf3bb21cd062b1b..83fbf5568cba4478bb5ca501aab9e6ec8b8b39fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "testasserts.h"
+#include "testutils/testasserts.h"
 
 #include <cmath>
 #include <cstdio>
index cb0a1ceeb5b1203298b6762c562ff8c7f3187397..99748ff77fbc39c64e18e54ffb71a357e6b16c02 100644 (file)
@@ -42,7 +42,7 @@
  */
 #include "gmxpre.h"
 
-#include "testfilemanager.h"
+#include "testutils/testfilemanager.h"
 
 #include <cstdio>
 
@@ -214,11 +214,8 @@ std::string TestFileManager::getInputFilePath(const char* filename)
         // Assume file is in global directory for simulation input files.
         return Path::join(getTestSimulationDatabaseDirectory(), filename);
     }
-    else
-    {
-        // Assume file is present locally without full name (e.g. extension).
-        return Path::join(getInputDataDirectory(), filename);
-    }
+    // Assume file is present locally without full name (e.g. extension).
+    return Path::join(getInputDataDirectory(), filename);
 }
 
 std::string TestFileManager::getInputFilePath(const std::string& filename)
index da0e74ae216395ea4e4cbc3b029f36d14553127f..d233ae017851335f68a9dd8ec3e80fc8e9d8a7c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "testfileredirector.h"
+#include "testutils/testfileredirector.h"
 
 #include <memory>
 #include <set>
index 753b814a0f3669d90f5a31ef8b80b335b47d1ccc..330e2563b6bc7e925f8ebbcd1afbf32a7494dc29 100644 (file)
@@ -42,7 +42,7 @@
  */
 #include "gmxpre.h"
 
-#include "testinit.h"
+#include "testutils/testinit.h"
 
 #include <cstdio>
 #include <cstdlib>
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/textwriter.h"
 
-#include "testutils/mpi_printer.h"
 #include "testutils/refdata.h"
 #include "testutils/test_hardware_environment.h"
 #include "testutils/testfilemanager.h"
 #include "testutils/testoptions.h"
 
+#include "mpi_printer.h"
+
 namespace gmx
 {
 namespace test
index 9a4446847ebd8e8e87b2fe40f444235bd42ca7f5..782d0bd162468fb04f748f717b946a77d2fda5ce 100644 (file)
@@ -42,7 +42,7 @@
  */
 #include "gmxpre.h"
 
-#include "testmatchers.h"
+#include "testutils/testmatchers.h"
 
 #include <memory>
 
index 02749d82596e62df18b5585d397ff80fce3ad4be..f2805afe245f3a358634875514ba35461cfe34d6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "testoptions.h"
+#include "testutils/testoptions.h"
 
 #include <list>
 
index 7a6d651ab43e09df488764b9644772482ae9d6b7..8a1030852713f5d6811975cd0aad3e10f96aa01b 100644 (file)
@@ -39,8 +39,10 @@ gmx_add_unit_test(TestUtilsUnitTests testutils-test
         testasserts_tests.cpp
         xvgtest_tests.cpp
         )
+target_link_libraries(testutils-test PRIVATE testutils)
 
 gmx_add_mpi_unit_test(TestUtilsMpiUnitTests testutils-mpi-test 2
     CPP_SOURCE_FILES
         mpitest.cpp
         )
+target_link_libraries(testutils-test PRIVATE testutils)
index 7dd2f7ca6c9a2b4a62f1896b457c50431b12fb67..0a9ec10a68cf3e8439e1b3aa27d7e29f2981ea1a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,7 +41,7 @@
  */
 #include "gmxpre.h"
 
-#include "textblockmatchers.h"
+#include "testutils/textblockmatchers.h"
 
 #include <memory>
 #include <regex>
index 872703eef14aa64a24ff11630ebb913ff173a837..9321f9ef7a945dacae246acbe8ac4ddeccf12c3a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 
 #include "gmxpre.h"
 
-#include "tprfilegenerator.h"
+#include "testutils/tprfilegenerator.h"
 
 #include "gromacs/gmxpreprocess/grompp.h"
 #include "gromacs/utility/textwriter.h"
index eb73e8fb2721f0564693086f48a75d929419320f..437f046a0f6a3c53b77be597bd5a4941e9ee86dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
  */
 #include "gmxpre.h"
 
-#include "xvgtest.h"
+#include "testutils/xvgtest.h"
 
 #include <cerrno>
 #include <cstdlib>