diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-27 15:19:50 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-27 15:19:50 (GMT) |
commit | fc344fa4e593ae5ca82693fd02213fecb8dce953 (patch) | |
tree | f39fe7d27a32d005629700a912399e5c966dbb8c /src | |
parent | 28edd851f8b7675fdadb51ebf906ae9cf8494dc8 (diff) |
Removed generated include files defining dirs of example files.
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/tests/compression/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/tests/compression/testsuite.c | 3 | ||||
-rw-r--r-- | src/tests/md_openmp.c | 5 | ||||
-rw-r--r-- | src/tests/md_openmp_util.c | 5 | ||||
-rw-r--r-- | src/tests/tng_io_testing.c | 19 |
6 files changed, 17 insertions, 26 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index bbd8203..b3ee6a1 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -4,12 +4,7 @@ endif() link_directories(${TNG_IO_BINARY_DIR}/src/lib) -set(EXAMPLE_FILES_DIR ${CMAKE_BINARY_DIR}/example_files/ CACHE STRING "Directory where to find input test files and save output files.") - -# Generate these two header files - even if the testing suites are not built. Avoids cppcheck errors. -configure_file(${TNG_IO_SOURCE_DIR}/include/tng_io_testing.h.in ${CMAKE_BINARY_DIR}/include/tng_io_testing.h) -configure_file(${TNG_IO_SOURCE_DIR}/include/compression/tng_compress_testing.h.in ${CMAKE_BINARY_DIR}/include/tng_compress_testing.h) -include_directories(${CMAKE_BINARY_DIR}/include/) +add_definitions(-DTNG_EXAMPLE_FILES_DIR="${CMAKE_BINARY_DIR}/example_files/") # Directory where to find input test files and save output files. if(TNG_BUILD_TEST) add_executable(tng_testing tng_io_testing.c) @@ -19,7 +14,7 @@ if(TNG_BUILD_TEST) endif() if(HAVE_INTTYPES_H) - set_target_properties(tng_testing PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1) + set_property(TARGET tng_testing APPEND PROPERTY COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1) endif() set_property(TARGET tng_testing PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests) diff --git a/src/tests/compression/CMakeLists.txt b/src/tests/compression/CMakeLists.txt index 9edf9de..075b06b 100644 --- a/src/tests/compression/CMakeLists.txt +++ b/src/tests/compression/CMakeLists.txt @@ -1,6 +1,6 @@ link_directories(${TNG_IO_BINARY_DIR}/src/lib) -set(TNG_COMPRESS_FILES_DIR ${CMAKE_BINARY_DIR}/test_tng_compress_files/ CACHE STRING "Directory where to write tng_compress test files.") +add_definitions(-DTNG_COMPRESS_FILES_DIR="${CMAKE_BINARY_DIR}/test_tng_compress_files/") # Directory where to write tng_compress test files. file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test_tng_compress_files) diff --git a/src/tests/compression/testsuite.c b/src/tests/compression/testsuite.c index 73ade62..c53759b 100644 --- a/src/tests/compression/testsuite.c +++ b/src/tests/compression/testsuite.c @@ -8,8 +8,7 @@ #include <stdlib.h> #include <string.h> #include <math.h> -#include <tng_compress.h> -#include "tng_compress_testing.h" +#include "compression/tng_compress.h" #include TESTPARAM #ifdef TEST_FLOAT diff --git a/src/tests/md_openmp.c b/src/tests/md_openmp.c index f9942ba..449810d 100644 --- a/src/tests/md_openmp.c +++ b/src/tests/md_openmp.c @@ -6,7 +6,6 @@ # include <math.h> # include <omp.h> # include "tng_io.h" -#include "tng_io_testing.h" int main (); void compute ( int np, int nd, double pos[], double vel[], @@ -128,8 +127,8 @@ int main () printf(" Cannot init trajectory.\n"); exit(1); } -#ifdef EXAMPLE_FILES_DIR - tng_output_file_set(traj, EXAMPLE_FILES_DIR "tng_md_out.tng"); +#ifdef TNG_EXAMPLE_FILES_DIR + tng_output_file_set(traj, TNG_EXAMPLE_FILES_DIR "tng_md_out.tng"); #else tng_output_file_set(traj, "/tmp/tng_md_out.tng"); #endif diff --git a/src/tests/md_openmp_util.c b/src/tests/md_openmp_util.c index e883c65..006d292 100644 --- a/src/tests/md_openmp_util.c +++ b/src/tests/md_openmp_util.c @@ -6,7 +6,6 @@ # include <math.h> # include <omp.h> # include "tng_io.h" -#include "tng_io_testing.h" int main (); void compute ( int np, int nd, float pos[], float vel[], @@ -121,8 +120,8 @@ int main () printf("\n"); printf(" Initializing trajectory storage.\n"); /* Initialize the TNG trajectory */ -#ifdef EXAMPLE_FILES_DIR - tng_util_trajectory_open(EXAMPLE_FILES_DIR "tng_md_out.tng", 'w', &traj); +#ifdef TNG_EXAMPLE_FILES_DIR + tng_util_trajectory_open(TNG_EXAMPLE_FILES_DIR "tng_md_out.tng", 'w', &traj); #else tng_util_trajectory_open("/tmp/tng_md_out.tng", 'w', &traj); #endif diff --git a/src/tests/tng_io_testing.c b/src/tests/tng_io_testing.c index a37710f..314df5a 100644 --- a/src/tests/tng_io_testing.c +++ b/src/tests/tng_io_testing.c @@ -18,7 +18,6 @@ #include <stdlib.h> #include <string.h> #include "tng_io.h" -#include "tng_io_testing.h" static tng_function_status tng_test_setup_molecules(tng_trajectory_t traj) { @@ -471,8 +470,8 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t traj) free(molpos); free(data); -#ifdef EXAMPLE_FILES_DIR - tng_input_file_set(traj, EXAMPLE_FILES_DIR "tng_test.tng"); +#ifdef TNG_EXAMPLE_FILES_DIR + tng_input_file_set(traj, TNG_EXAMPLE_FILES_DIR "tng_test.tng"); #else tng_input_file_set(traj, "/tmp/tng_test.tng"); #endif @@ -593,9 +592,9 @@ int main() printf("Creation time: %s\n", time_str); -#ifdef EXAMPLE_FILES_DIR - tng_input_file_set(traj, EXAMPLE_FILES_DIR "tng_example.tng"); - tng_output_file_set(traj, EXAMPLE_FILES_DIR "tng_example_out.tng"); +#ifdef TNG_EXAMPLE_FILES_DIR + tng_input_file_set(traj, TNG_EXAMPLE_FILES_DIR "tng_example.tng"); + tng_output_file_set(traj, TNG_EXAMPLE_FILES_DIR "tng_example_out.tng"); #else tng_input_file_set(traj, "tng_example.tng"); tng_output_file_set(traj, "/tmp/tng_example_out.tng"); @@ -634,8 +633,8 @@ int main() } -#ifdef EXAMPLE_FILES_DIR - tng_output_file_set(traj, EXAMPLE_FILES_DIR "tng_test.tng"); +#ifdef TNG_EXAMPLE_FILES_DIR + tng_output_file_set(traj, TNG_EXAMPLE_FILES_DIR "tng_test.tng"); #else tng_output_file_set(traj, "/tmp/tng_test.tng"); #endif @@ -672,8 +671,8 @@ int main() } -#ifdef EXAMPLE_FILES_DIR - stat = tng_util_trajectory_open(EXAMPLE_FILES_DIR "tng_test.tng", 'r', &traj); +#ifdef TNG_EXAMPLE_FILES_DIR + stat = tng_util_trajectory_open(TNG_EXAMPLE_FILES_DIR "tng_test.tng", 'r', &traj); #else stat = tng_util_trajectory_open("/tmp/tng_test.tng", 'r', &traj); #endif |