Commit a407800a authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Fixed MPI tests in CMAKE.

parent 3d2dfc7f
......@@ -3,6 +3,6 @@ exatn_add_test(ServiceRegistryTester ServiceRegistryTester.cpp)
target_include_directories(ServiceRegistryTester PRIVATE testplugin ${CMAKE_SOURCE_DIR}/src/exatn ${CMAKE_BINARY_DIR})
target_link_libraries(ServiceRegistryTester PRIVATE exatn CppMicroServices)
exatn_add_test(NumServerTester NumServerTester.cpp)
exatn_add_mpi_test(NumServerTester NumServerTester.cpp)
#target_include_directories(NumServerTester PRIVATE testplugin ${CMAKE_SOURCE_DIR}/src/exatn ${CMAKE_BINARY_DIR})
target_link_libraries(NumServerTester PRIVATE exatn)
exatn_add_test(TAProLInterpreterTester TAProLInterpreterTester.cpp)
exatn_add_mpi_test(TAProLInterpreterTester TAProLInterpreterTester.cpp)
target_include_directories(TAProLInterpreterTester
PUBLIC
${CMAKE_SOURCE_DIR}/tpls/antlr/runtime/src
......
......@@ -8,7 +8,8 @@ TEST(TAProLInterpreterTester, checkSimple) {
TAProLInterpreter interpreter;
const std::string src = R"src(entry: main
const std::string src = R"src(
entry: main
scope main group()
subspace(): s0=[0:127]
index(s0): a,b,c,d,i,j,k,l
......@@ -23,7 +24,8 @@ scope main group()
~Z2
~T2
~H2
end scope main)src";
end scope main
)src";
interpreter.interpret(src);
}
......
exatn_add_test(TensorRuntimeTester TensorRuntimeTester.cpp)
exatn_add_mpi_test(TensorRuntimeTester TensorRuntimeTester.cpp)
target_link_libraries(TensorRuntimeTester PRIVATE exatn-runtime exatn-numerics exatn)
......@@ -48,6 +48,28 @@ if(EXATN_BUILD_TESTS)
add_test(${TESTNAME} ${TESTNAME})
set_target_properties(${TESTNAME} PROPERTIES FOLDER tests)
endmacro()
if(MPI_LIB AND NOT MPI_LIB STREQUAL "NONE")
macro(exatn_add_mpi_test TESTNAME)
add_executable(${TESTNAME} ${ARGN})
target_link_libraries(${TESTNAME} PRIVATE gtest gmock gtest_main)
set_target_properties(${TESTNAME} PROPERTIES FOLDER tests)
get_filename_component(MPI_BIN_PATH ${MPI_CXX_COMPILER} DIRECTORY)
add_test(NAME ${TESTNAME} COMMAND ${MPI_BIN_PATH}/mpiexec -np 2 ./${TESTNAME})
endmacro()
else()
macro(exatn_add_mpi_test TESTNAME)
add_executable(${TESTNAME} ${ARGN})
target_link_libraries(${TESTNAME} PRIVATE gtest gmock gtest_main)
add_test(${TESTNAME} ${TESTNAME})
set_target_properties(${TESTNAME} PROPERTIES FOLDER tests)
endmacro()
endif()
endif()
set(TALSHXX_EXISTS "NO")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment