diff options
-rw-r--r-- | test/CMakeLists.txt | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 14d75f65..cdd3ed8b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -28,24 +28,41 @@ if(WIN32) set(SHELL_PREFIX "C:\\MinGW\\msys\\1.0\\bin\\sh") endif() -file(READ ${CMAKE_CURRENT_SOURCE_DIR}/Maketests BASIC_TESTS) -string(REGEX REPLACE "^Gt-dummy:\n" "" BASIC_TESTS "${BASIC_TESTS}") -string(REGEX MATCHALL "[a-zA-Z0-9_]+:\n" BASIC_TESTS "${BASIC_TESTS}") -string(REGEX REPLACE ":\n" "" BASIC_TESTS "${BASIC_TESTS}") -foreach(testcase ${BASIC_TESTS} ) - set(options "") - if(${testcase} STREQUAL lintold) - set(options "--lint-old") - endif() - if(${testcase} STREQUAL defref OR ${testcase} STREQUAL fmtspcl OR - ${testcase} STREQUAL lintwarn OR ${testcase} STREQUAL noeffect OR - ${testcase} STREQUAL nofmtch OR ${testcase} STREQUAL shadow OR - ${testcase} STREQUAL uninit2 OR ${testcase} STREQUAL uninit3 OR - ${testcase} STREQUAL uninit4 OR ${testcase} STREQUAL uninit5 OR - ${testcase} STREQUAL uninitialized) - set(options "--lint") - endif() +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am ALL_TESTS) +string(REGEX MATCHALL "[A-Z_]*_TESTS " ALL_TESTS "${ALL_TESTS}") +string(REGEX REPLACE "_TESTS " ";" ALL_TESTS "${ALL_TESTS}") +foreach(testgroup ${ALL_TESTS} ) + file(READ ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am ONE_GROUP) + string(REGEX MATCH "${testgroup}_TESTS = [a-z0-9_ \\\n\t]*" ONE_GROUP "${ONE_GROUP}") + string(REGEX REPLACE "${testgroup}_TESTS = " "" ONE_GROUP "${ONE_GROUP}") + string(REGEX REPLACE "[\\\n\t]" "" ONE_GROUP "${ONE_GROUP}") + string(REGEX REPLACE " " ";" ONE_GROUP "${ONE_GROUP}") + foreach(testcase ${ONE_GROUP} ) + set(options "") + if(${testcase} STREQUAL lintold) + set(options "--lint-old") + endif() + if(${testcase} STREQUAL defref OR ${testcase} STREQUAL fmtspcl OR + ${testcase} STREQUAL lintwarn OR ${testcase} STREQUAL noeffect OR + ${testcase} STREQUAL nofmtch OR ${testcase} STREQUAL shadow OR + ${testcase} STREQUAL uninit2 OR ${testcase} STREQUAL uninit3 OR + ${testcase} STREQUAL uninit4 OR ${testcase} STREQUAL uninit5 OR + ${testcase} STREQUAL uninitialized) + set(options "--lint") + endif() - add_test(${testcase} ${SHELL_PREFIX} ${CMAKE_SOURCE_DIR}/cmake/basictest ${CMAKE_BINARY_DIR}/gawk ${testcase} ${options} ) -endforeach(testcase) + # Check for test cases that cause a "hang" in test case execution. + # Each of them has to be analysed until all of them disappear from this list. + if(${testcase} STREQUAL getline2 OR ${testcase} STREQUAL litoct OR + ${testcase} STREQUAL nonl OR ${testcase} STREQUAL poundbang OR + ${testcase} STREQUAL beginfile1 OR ${testcase} STREQUAL manyfiles OR + ${testcase} STREQUAL rsstart2 OR ${testcase} STREQUAL strftime OR + ${testcase} STREQUAL readdir + ) + add_test(${testcase} ${SHELL_PREFIX} ${CMAKE_SOURCE_DIR}/cmake/basictest ${CMAKE_BINARY_DIR}/gawk ${testcase}_FAILS ${options} ) + else() + add_test(${testcase} ${SHELL_PREFIX} ${CMAKE_SOURCE_DIR}/cmake/basictest ${CMAKE_BINARY_DIR}/gawk ${testcase} ${options} ) + endif() + endforeach(testcase) +endforeach(testgroup) |