From 257bbe7c5aaa35e5427aa30624aee45dce2e3b65 Mon Sep 17 00:00:00 2001 From: Haocheng Liu <haocheng.liu@kitware.com> Date: Tue, 5 Sep 2017 11:11:14 -0400 Subject: [PATCH] BUG: Guard BP engine tests when adios1 is not enabled Remove meaningless code(AddTransport which is not implemented yet) in HDF5 test as well. --- testing/adios2/engine/bp/CMakeLists.txt | 68 ++++++++++--------- .../adios2/engine/hdf5/TestHDF5WriteRead.cpp | 27 ++++---- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/testing/adios2/engine/bp/CMakeLists.txt b/testing/adios2/engine/bp/CMakeLists.txt index da8fa30da..fb032ba79 100644 --- a/testing/adios2/engine/bp/CMakeLists.txt +++ b/testing/adios2/engine/bp/CMakeLists.txt @@ -5,47 +5,49 @@ # MPI versions of the test are not properly implemented at the moment -add_executable(TestBPWriteRead TestBPWriteRead.cpp) -target_link_libraries(TestBPWriteRead adios2 gtest adios1::adios) +if (ADIOS2_HAVE_ADIOS1) + add_executable(TestBPWriteRead TestBPWriteRead.cpp) + target_link_libraries(TestBPWriteRead adios2 gtest adios1::adios) -add_executable(TestBPWriteReadAttributes TestBPWriteReadAttributes.cpp) -target_link_libraries(TestBPWriteReadAttributes adios2 gtest adios1::adios) + add_executable(TestBPWriteReadAttributes TestBPWriteReadAttributes.cpp) + target_link_libraries(TestBPWriteReadAttributes adios2 gtest adios1::adios) -add_executable(TestBPWriteReadstdio TestBPWriteReadstdio.cpp) -target_link_libraries(TestBPWriteReadstdio adios2 gtest adios1::adios) + add_executable(TestBPWriteReadstdio TestBPWriteReadstdio.cpp) + target_link_libraries(TestBPWriteReadstdio adios2 gtest adios1::adios) -add_executable(TestBPWriteReadfstream TestBPWriteReadfstream.cpp) -target_link_libraries(TestBPWriteReadfstream adios2 gtest adios1::adios) + add_executable(TestBPWriteReadfstream TestBPWriteReadfstream.cpp) + target_link_libraries(TestBPWriteReadfstream adios2 gtest adios1::adios) -add_executable(TestBPWriteProfilingJSON TestBPWriteProfilingJSON.cpp) -target_link_libraries(TestBPWriteProfilingJSON - adios2 gtest NLohmannJson -) + add_executable(TestBPWriteProfilingJSON TestBPWriteProfilingJSON.cpp) + target_link_libraries(TestBPWriteProfilingJSON + adios2 gtest NLohmannJson + ) -if(ADIOS2_HAVE_MPI) - target_include_directories(TestBPWriteRead PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries(TestBPWriteRead ${MPI_C_LIBRARIES}) + if(ADIOS2_HAVE_MPI) + target_include_directories(TestBPWriteRead PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries(TestBPWriteRead ${MPI_C_LIBRARIES}) - target_include_directories(TestBPWriteReadAttributes PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries(TestBPWriteReadAttributes ${MPI_C_LIBRARIES}) + target_include_directories(TestBPWriteReadAttributes PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries(TestBPWriteReadAttributes ${MPI_C_LIBRARIES}) - target_include_directories(TestBPWriteReadstdio PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries(TestBPWriteReadstdio ${MPI_C_LIBRARIES}) + target_include_directories(TestBPWriteReadstdio PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries(TestBPWriteReadstdio ${MPI_C_LIBRARIES}) - target_include_directories(TestBPWriteReadfstream PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries(TestBPWriteReadfstream ${MPI_C_LIBRARIES}) + target_include_directories(TestBPWriteReadfstream PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries(TestBPWriteReadfstream ${MPI_C_LIBRARIES}) - target_include_directories(TestBPWriteProfilingJSON PRIVATE ${MPI_C_INCLUDE_PATH}) - target_link_libraries(TestBPWriteProfilingJSON ${MPI_C_LIBRARIES}) + target_include_directories(TestBPWriteProfilingJSON PRIVATE ${MPI_C_INCLUDE_PATH}) + target_link_libraries(TestBPWriteProfilingJSON ${MPI_C_LIBRARIES}) - set(extra_test_args - EXEC_WRAPPER - ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} - ) -endif() + set(extra_test_args + EXEC_WRAPPER + ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} + ) + endif() -gtest_add_tests(TARGET TestBPWriteRead ${extra_test_args}) -gtest_add_tests(TARGET TestBPWriteReadAttributes ${extra_test_args}) -gtest_add_tests(TARGET TestBPWriteReadstdio ${extra_test_args}) -gtest_add_tests(TARGET TestBPWriteReadfstream ${extra_test_args}) -gtest_add_tests(TARGET TestBPWriteProfilingJSON ${extra_test_args}) + gtest_add_tests(TARGET TestBPWriteRead ${extra_test_args}) + gtest_add_tests(TARGET TestBPWriteReadAttributes ${extra_test_args}) + gtest_add_tests(TARGET TestBPWriteReadstdio ${extra_test_args}) + gtest_add_tests(TARGET TestBPWriteReadfstream ${extra_test_args}) + gtest_add_tests(TARGET TestBPWriteProfilingJSON ${extra_test_args}) +endif() diff --git a/testing/adios2/engine/hdf5/TestHDF5WriteRead.cpp b/testing/adios2/engine/hdf5/TestHDF5WriteRead.cpp index d03c6558f..dd92b35c8 100644 --- a/testing/adios2/engine/hdf5/TestHDF5WriteRead.cpp +++ b/testing/adios2/engine/hdf5/TestHDF5WriteRead.cpp @@ -278,11 +278,12 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteHDF5Read1D8) // Create the ADIOS 1 Engine io.SetEngine("HDF5Writer"); -#ifdef ADIOS2_HAVE_MPI - io.AddTransport("file", {{"library", "MPI"}}); -#else + // HDf5 engine calls the HDF5 common object that calls the hDF5 library. + // The IO functionality, SetParameters and AddTransports will be added + // in the future. For now `io.AddTransport("file", { + // "library", "MPI"}});` is omitted. + // }) io.AddTransport("file"); -#endif auto engine = io.Open(fname, adios2::OpenMode::Write); ASSERT_NE(engine.get(), nullptr); @@ -540,11 +541,12 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteHDF5Read2D2x4) // Create the ADIOS 1 Engine io.SetEngine("HDF5Writer"); -#ifdef ADIOS2_HAVE_MPI - io.AddTransport("file", {{"library", "MPI"}}); -#else + // HDf5 engine calls the HDF5 common object that calls the hDF5 library. + // The IO functionality, SetParameters and AddTransports will be added + // in the future. For now `io.AddTransport("file", { + // "library", "MPI"}});` is omitted. + // }) io.AddTransport("file"); -#endif auto engine = io.Open(fname, adios2::OpenMode::Write); ASSERT_NE(engine.get(), nullptr); @@ -815,11 +817,12 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteHDF5Read2D4x2) // Create the ADIOS 1 Engine io.SetEngine("HDF5Writer"); -#ifdef ADIOS2_HAVE_MPI - io.AddTransport("file", {{"library", "MPI"}}); -#else + // HDf5 engine calls the HDF5 common object that calls the hDF5 library. + // The IO functionality, SetParameters and AddTransports will be added + // in the future. For now `io.AddTransport("file", { + // "library", "MPI"}});` is omitted. + // }) io.AddTransport("file"); -#endif auto engine = io.Open(fname, adios2::OpenMode::Write); ASSERT_NE(engine.get(), nullptr); -- GitLab