From bed755dcb7962d9fba0bb36519938a819d334111 Mon Sep 17 00:00:00 2001 From: Zeex Date: Fri, 27 Apr 2018 12:10:09 +0600 Subject: [PATCH] Fix build error with CMake < 3.0 --- source/compiler/tests/CMakeLists.txt | 46 +++++++++++++--------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/source/compiler/tests/CMakeLists.txt b/source/compiler/tests/CMakeLists.txt index 55ce454..ef77935 100644 --- a/source/compiler/tests/CMakeLists.txt +++ b/source/compiler/tests/CMakeLists.txt @@ -4,10 +4,10 @@ set(DEFAULT_COMPILER_OPTIONS "-(+") function(add_compiler_test test_name options) - add_test(NAME ${test_name} - COMMAND $ ${DEFAULT_COMPILER_OPTIONS} ${options}) - set_tests_properties(${test_name} PROPERTIES - ENVIRONMENT PATH=$) + add_test(NAME ${test_name} + COMMAND $ ${DEFAULT_COMPILER_OPTIONS} ${options}) + set_tests_properties(${test_name} PROPERTIES + ENVIRONMENT PATH=$) endfunction() # Compile tests @@ -16,42 +16,40 @@ endfunction() # doesn't match the expected pattern. add_compiler_test(gh_217 ${CMAKE_CURRENT_SOURCE_DIR}/gh_217.pwn) -set_tests_properties(gh_217 PROPERTIES PASS_REGULAR_EXPRESSION "\ -.*\\.pwn\\(11\\) : warning 237: user warning: this is warning 1\ -.*\\.pwn\\(13\\) : warning 237: user warning: this iswarning 2\ -.*\\.pwn\\(15\\) : warning 237: user warning: this is warning 3\ -.*\\.pwn\\(17\\) : warning 237: user warning: this is warning 4\ -.*\\.pwn\\(27\\) : warning 234: function is deprecated \\(symbol \"f\"\\) don't use this functionplease\ -.*\\.pwn\\(32\\) : warning 234: function is deprecated \\(symbol \"f\"\\) don't use this functionplease\ +set_tests_properties(gh_217 PROPERTIES PASS_REGULAR_EXPRESSION ".*\\.pwn\\(11\\) : warning 237: user warning: this is warning 1 +.*\\.pwn\\(13\\) : warning 237: user warning: this iswarning 2 +.*\\.pwn\\(15\\) : warning 237: user warning: this is warning 3 +.*\\.pwn\\(17\\) : warning 237: user warning: this is warning 4 +.*\\.pwn\\(27\\) : warning 234: function is deprecated \\(symbol \"f\"\\) don't use this functionplease +.*\\.pwn\\(32\\) : warning 234: function is deprecated \\(symbol \"f\"\\) don't use this functionplease ") add_compiler_test(reset_errline_gh_230 ${CMAKE_CURRENT_SOURCE_DIR}/reset_errline_gh_230.pwn) -set_tests_properties(reset_errline_gh_230 PROPERTIES PASS_REGULAR_EXPRESSION "\ -.*\\.pwn\\(2\\) : error 017: undefined symbol \\\"undefined\\\"\ -.*\\.pwn\\(2\\) : warning 215: expression has no effect\ -.*\\.pwn\\(7\\) : warning 204: symbol is assigned a value that is never used: \\\"y\\\"\ -.*\\.pwn\\(4\\) : warning 204: symbol is assigned a value that is never used: \\\"x\\\"\ +set_tests_properties(reset_errline_gh_230 PROPERTIES PASS_REGULAR_EXPRESSION +".*\\.pwn\\(2\\) : error 017: undefined symbol \\\"undefined\\\" +.*\\.pwn\\(2\\) : warning 215: expression has no effect +.*\\.pwn\\(7\\) : warning 204: symbol is assigned a value that is never used: \\\"y\\\" +.*\\.pwn\\(4\\) : warning 204: symbol is assigned a value that is never used: \\\"x\\\" ") add_compiler_test(unused_symbol_line_gh_252 ${CMAKE_CURRENT_SOURCE_DIR}/unused_symbol_line_gh_252.pwn) -set_tests_properties(unused_symbol_line_gh_252 PROPERTIES PASS_REGULAR_EXPRESSION "\ -.*\\.pwn\\(4\\) : warning 203: symbol is never used: \\\"y\\\" +set_tests_properties(unused_symbol_line_gh_252 PROPERTIES PASS_REGULAR_EXPRESSION +".*\\.pwn\\(4\\) : warning 203: symbol is never used: \\\"y\\\" .*\\.pwn\\(8\\) : warning 203: symbol is never used: \\\"z\\\" .*\\.pwn\\(1\\) : warning 203: symbol is never used: \\\"x\\\" ") add_compiler_test(gh_283 ${CMAKE_CURRENT_SOURCE_DIR}/gh_283.pwn) -set_tests_properties(gh_283 PROPERTIES PASS_REGULAR_EXPRESSION "\ -.*\\.pwn\\(5\\) : warning 234: function is deprecated \\(symbol \"print\"\\)\ -") +set_tests_properties(gh_283 PROPERTIES PASS_REGULAR_EXPRESSION + ".*\\.pwn\\(5\\) : warning 234: function is deprecated \\(symbol \"print\"\\)") add_compiler_test(too_many_args_crash_gh_298 ${CMAKE_CURRENT_SOURCE_DIR}/too_many_args_crash_gh_298.pwn) set_tests_properties(too_many_args_crash_gh_298 PROPERTIES PASS_REGULAR_EXPRESSION "too many function arguments") add_compiler_test(meaningless_class_specifiers_gh_172 ${CMAKE_CURRENT_SOURCE_DIR}/meaningless_class_specifiers_gh_172.pwn) -set_tests_properties(meaningless_class_specifiers_gh_172 PROPERTIES PASS_REGULAR_EXPRESSION "\ -.*\\.pwn\\(1\\) : warning 238: meaningless combination of class specifiers \\(const reference\\)\ -.*\\.pwn\\(1 \\-\\- 2\\) : warning 238: meaningless combination of class specifiers \\(const variable arguments\\)\ +set_tests_properties(meaningless_class_specifiers_gh_172 PROPERTIES PASS_REGULAR_EXPRESSION +".*\\.pwn\\(1\\) : warning 238: meaningless combination of class specifiers \\(const reference\\) +.*\\.pwn\\(1 \\-\\- 2\\) : warning 238: meaningless combination of class specifiers \\(const variable arguments\\) ") # Crashers