Fix that TNG tests were not run
authorRoland Schulz <roland@utk.edu>
Thu, 28 Aug 2014 19:38:24 +0000 (15:38 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 3 Sep 2014 17:44:48 +0000 (19:44 +0200)
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
src/config.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp
src/programs/mdrun/tests/rerun.cpp

index ed24af96150276cb1bf39fd1106cd3212660f105..ce678e504ce1852319479944a09d0a820f73c36d 100644 (file)
@@ -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
 ########################################################################
index 4aa43dc6121e4166fc097fa00ef82fec439c3acf..3f734ba30d108617727bffe8988871ce77b5f6a8 100644 (file)
 /* Define if we have pipes */
 #cmakedefine HAVE_PIPES
 
+/* Define if we have zlib */
+#cmakedefine HAVE_ZLIB
+
 /*! \endcond */
index c765548ae1e9bc708815fe9f6c77a3059c87adb3..1bffd962de904aafbce5595bc1f0697ddf9dc1bc 100644 (file)
@@ -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})
index 87996bc8afb0e762dbac8caf8583c9223f5533e8..bea1f8044d982c14e674751786b0602b0fb508b8 100644 (file)
@@ -44,6 +44,8 @@
 #include "testutils/cmdlinetest.h"
 #include "gromacs/utility/arrayref.h"
 
+#include "config.h"
+
 namespace
 {
 
index d1df11f8a38d85a27e9302288b5677be96990095..0558f9a622a1d2c48b2471edfee61938a4bf748f 100644 (file)
@@ -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",