diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | test/run.cmake | 13 |
2 files changed, 10 insertions, 7 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5248b72..0c6550d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,7 +22,7 @@ macro(castxml_test_cmd test) NAME cmd.${test} COMMAND ${CMAKE_COMMAND} "-Dcommand:STRING=${command}" - "-Dtest=cmd.${test}" + "-Dexpect=cmd.${test}" -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake ) endmacro() @@ -38,7 +38,7 @@ macro(castxml_test_gccxml_common prefix ext std test) NAME ${prefix}.${test} COMMAND ${CMAKE_COMMAND} "-Dcommand:STRING=${command}" - "-Dtest=${prefix}.${test}" + "-Dexpect=${prefix}.${test}" "-Dxml=${prefix}.${test}.xml" "-Dxmllint=${LIBXML2_XMLLINT_EXECUTABLE}" -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake diff --git a/test/run.cmake b/test/run.cmake index 3699b6c..560327e 100644 --- a/test/run.cmake +++ b/test/run.cmake @@ -45,12 +45,15 @@ foreach(o result stdout stderr ${maybe_xml}) set(actual-${o} "Actual ${o}:\n${actual-${o}}\n") set(expect-${o} "") - if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/expect/${test}-${o}.txt) - file(READ ${CMAKE_CURRENT_LIST_DIR}/expect/${test}-${o}.txt expect_${o}) - elseif(DEFINED default_${o}) + unset(expect_${o}) + foreach(e ${expect}) + if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/expect/${e}-${o}.txt) + file(READ ${CMAKE_CURRENT_LIST_DIR}/expect/${e}-${o}.txt expect_${o}) + break() + endif() + endforeach() + if(NOT DEFINED expect_${o} AND DEFINED default_${o}) set(expect_${o} "${default_${o}}") - else() - unset(expect_${o}) endif() if(DEFINED expect_${o}) |