Commit d0fd7237 authored by Kohei Yoshida's avatar Kohei Yoshida

Properly execute thread parser tests as part of ctest.

This fixes #14.
parent a94043d8
Pipeline #45198590 passed with stage
in 4 minutes
......@@ -21,39 +21,23 @@ target_link_libraries(ixion-parser libixion)
target_link_libraries(ixion-sorter libixion)
target_link_libraries(ixion-formula-tokenizer libixion)
# tests
# Copy the binaries necessary for running the parser tests below.
add_custom_command(TARGET ixion-parser POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:libixion>
$<TARGET_FILE_DIR:ixion-parser>
$<TARGET_FILE:libixion> $<TARGET_FILE:ixion-parser>
${CMAKE_CURRENT_BINARY_DIR}
)
# test programs
file(GLOB PARSER_TEST_FILES ${PROJECT_SOURCE_DIR}/test/*.txt)
foreach(_I RANGE 8)
set(_IS "${_I}")
add_custom_target(parser-test-t${_IS} COMMAND $<TARGET_FILE:ixion-parser> -t ${_I} ${PARSER_TEST_FILES} DEPENDS ixion-parser)
endforeach()
add_dependencies(check ixion-parser)
foreach(_I RANGE 7)
set(_IS "${_I}")
math(EXPR _INEXT "${_I}+1")
add_dependencies(parser-test-t${_INEXT} parser-test-t${_IS})
foreach(_I RANGE 8)
add_test(parser-test-t${_I} ${CMAKE_CURRENT_BINARY_DIR}/ixion-parser -t ${_I} ${PARSER_TEST_FILES})
endforeach()
add_dependencies(check
parser-test-t0
parser-test-t1
parser-test-t2
parser-test-t3
parser-test-t4
parser-test-t5
parser-test-t6
parser-test-t7
parser-test-t8
)
install(TARGETS ixion-parser ixion-sorter ixion-formula-tokenizer
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
......
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