Add test for #220

This commit is contained in:
Zeex 2018-01-05 05:51:02 +06:00
parent 64563ff994
commit 97586a750e
2 changed files with 22 additions and 0 deletions

View File

@ -10,6 +10,12 @@ function(add_compiler_test test_name options)
ENVIRONMENT PATH=$<TARGET_FILE_DIR:pawnc>)
endfunction()
#
# Compile tests
#
# These tests compare compile output against a regular expression and fail if the output
# 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
".*: warning 237: user warning: this is warning 1[\r\n]+\
@ -18,3 +24,13 @@ set_tests_properties(gh_217 PROPERTIES PASS_REGULAR_EXPRESSION
.*: warning 237: user warning: this is warning 4[\r\n]+\
.*: warning 234: function is deprecated \\(symbol \"f\"\\) don't use this functionplease[\r\n]+\
.*: warning 234: function is deprecated \\(symbol \"f\"\\) don't use this functionplease")
#
# Crashers
#
# These tests simply check that the compiler doesn't crash.
#
# TODO: Probably need to support tests that exist with a non-zero code but don't crash?
# Right now this will cause a failure.
#
add_compiler_test(md_array_crash_gh_220 ${CMAKE_CURRENT_SOURCE_DIR}/md_array_crash_gh_220.pwn)

View File

@ -0,0 +1,6 @@
new a[1000][500] = { { 0, 1, ... }, ... };
new b[2000][500] = { { 0, -1, ... }, ... };
main() {
a[0][0] = b[0][0];
}