From af78f4c5ce6924e1b7ee6fa65fa0b462df4d76a5 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Thu, 28 Aug 2014 15:38:24 -0400 Subject: [PATCH] Fix that TNG tests were not run Missing config.h meant there were not run. Also fix rerun test without zlib. The input is zlib compressed and thus should only be tested if zlib support is available. Change-Id: Ia80abcb7584f698512578652621cb16c16e4188a --- CMakeLists.txt | 7 +++++++ src/config.h.cmakein | 3 +++ src/gromacs/CMakeLists.txt | 5 ----- src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp | 2 ++ src/programs/mdrun/tests/rerun.cpp | 4 +++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed24af9615..ce678e504c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -596,6 +596,13 @@ if (GMX_BUILD_UNITTESTS AND NOT HAVE_LIBXML2) "Either set GMX_BUILD_UNITTESTS=OFF or tell CMake how to find a working version of libxml2.") endif() +if(GMX_USE_TNG AND NOT GMX_EXTERNAL_TNG) + # TNG wants zlib if it is available + find_package(ZLIB QUIET) + include(gmxTestZLib) + gmx_test_zlib(HAVE_ZLIB) +endif() + ######################################################################## # Generate development version info for cache ######################################################################## diff --git a/src/config.h.cmakein b/src/config.h.cmakein index 4aa43dc612..3f734ba30d 100644 --- a/src/config.h.cmakein +++ b/src/config.h.cmakein @@ -352,4 +352,7 @@ /* Define if we have pipes */ #cmakedefine HAVE_PIPES +/* Define if we have zlib */ +#cmakedefine HAVE_ZLIB + /*! \endcond */ diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index c765548ae1..1bffd962de 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -59,11 +59,6 @@ if(GMX_USE_TNG) include_directories(${TNG_IO_INCLUDE_DIRS}) endif() if(NOT GMX_EXTERNAL_TNG) - # TNG wants zlib if it is available - find_package(ZLIB QUIET) - include(gmxTestZLib) - gmx_test_zlib(HAVE_ZLIB) - include(${CMAKE_SOURCE_DIR}/src/external/tng_io/BuildTNG.cmake) tng_get_source_list(TNG_SOURCES TNG_IO_DEFINITIONS) list(APPEND LIBGROMACS_SOURCES ${TNG_SOURCES}) diff --git a/src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp b/src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp index 87996bc8af..bea1f8044d 100644 --- a/src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp +++ b/src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp @@ -44,6 +44,8 @@ #include "testutils/cmdlinetest.h" #include "gromacs/utility/arrayref.h" +#include "config.h" + namespace { diff --git a/src/programs/mdrun/tests/rerun.cpp b/src/programs/mdrun/tests/rerun.cpp index d1df11f8a3..0558f9a622 100644 --- a/src/programs/mdrun/tests/rerun.cpp +++ b/src/programs/mdrun/tests/rerun.cpp @@ -45,6 +45,8 @@ #include "gromacs/options/filenameoption.h" #include "testutils/cmdlinetest.h" +#include "config.h" + namespace { @@ -75,7 +77,7 @@ TEST_P(MdrunRerun, WithDifferentInputFormats) * version. */ const char *trajectoryFileNames[] = { "../../../gromacs/gmxana/legacytests/spc2-traj.trr", -#ifdef GMX_USE_TNG +#if defined GMX_USE_TNG && defined HAVE_ZLIB "../../../gromacs/gmxana/legacytests/spc2-traj.tng", #endif "../../../gromacs/gmxana/legacytests/spc2-traj.xtc", -- 2.22.0