Skip to content

Commit

Permalink
BUG: Guard BP engine tests when adios1 is not enabled
Browse files Browse the repository at this point in the history
Remove meaningless code(AddTransport which is not implemented yet) in
HDF5 test as well.
  • Loading branch information
Haocheng Liu committed Sep 6, 2017
1 parent 0d1ee65 commit 257bbe7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 45 deletions.
68 changes: 35 additions & 33 deletions testing/adios2/engine/bp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
27 changes: 15 additions & 12 deletions testing/adios2/engine/hdf5/TestHDF5WriteRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 257bbe7

Please sign in to comment.