Commit 5b6c905e authored by Bednárek David RNDr. Ph.D.'s avatar Bednárek David RNDr. Ph.D.
Browse files

ctest configured with -z and diff judge

parent a80b27d6
......@@ -4,14 +4,19 @@ function(MAKE_TEST ANUM NAME)
set(TEST_EXE "${SOL_PREFIX}cecko${ANUM}")
set(TEST_MESSAGE "cecko${ANUM}")
set(TEST_INPUT "${NAME}.c")
set(TEST_OUTPUT "${NAME}.out")
set(TEST_GOLD "${NAME}.${TEST_EXE}.gold")
set(TEST_OUTPUT "${NAME}.${TEST_EXE}.out")
set(TEST_GOLD "${NAME}.cecko${ANUM}.gold")
add_test(NAME "${TEST_NAME_RUN}" COMMAND "${TEST_EXE}" "-z" "${TEST_OUTPUT}" "${TEST_INPUT}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set_tests_properties("${TEST_NAME_RUN}" PROPERTIES PASS_REGULAR_EXPRESSION ".*${TEST_MESSAGE} done.*")
set(FNAME_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${TEST_OUTPUT}")
add_test(NAME "${TEST_NAME_RUN}" COMMAND "${TEST_EXE}" "-z" "${FNAME_OUTPUT}" "${TEST_INPUT}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
#set_tests_properties("${TEST_NAME_RUN}" PROPERTIES PASS_REGULAR_EXPRESSION ".*${TEST_MESSAGE} done.*")
set_tests_properties("${TEST_NAME_RUN}" PROPERTIES FIXTURES_SETUP "${TEST_OUTPUT}")
set_tests_properties("${TEST_NAME_RUN}" PROPERTIES TIMEOUT "5")
set_tests_properties("${TEST_NAME_RUN}" PROPERTIES LABELS "${TEST_EXE}")
add_test(NAME "${TEST_NAME_JUDGE}" COMMAND "${CMAKE_COMMAND}" "-E" "compare_files" "--ignore-eol" "${FNAME_OUTPUT}" "${TEST_GOLD}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set_tests_properties("${TEST_NAME_JUDGE}" PROPERTIES FIXTURES_REQUIRED "${TEST_OUTPUT}")
set_tests_properties("${TEST_NAME_JUDGE}" PROPERTIES TIMEOUT "5")
endfunction()
MAKE_TEST("1" "test1")
......
Supports Markdown
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