From 666c4deb3f97d0a1a1c2b41aa632e1907117de07 Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Mon, 13 Apr 2020 00:33:47 +0200 Subject: [PATCH 1/2] tasks and lit.cfg: adapt for running on Windows --- tasks.py | 46 +++++++++++++++---- tests/integration/lit.cfg | 5 +- .../sample.itest | 2 +- .../sample.itest | 2 +- .../sample.itest | 1 + .../sample.itest | 2 +- tests/integration/tools/FileCheck/FileCheck | 5 -- .../tools/FileCheck/FileCheck-8.0.1 | 13 ------ .../tools/FileCheck/FileCheck-9.0.1 | 13 ------ 9 files changed, 45 insertions(+), 44 deletions(-) delete mode 100755 tests/integration/tools/FileCheck/FileCheck delete mode 100755 tests/integration/tools/FileCheck/FileCheck-8.0.1 delete mode 100755 tests/integration/tools/FileCheck/FileCheck-9.0.1 diff --git a/tasks.py b/tasks.py index 8f76394..f85afa1 100644 --- a/tasks.py +++ b/tasks.py @@ -1,4 +1,5 @@ import os +import platform import re from invoke import task @@ -7,15 +8,37 @@ FILECHECK_LLVM_9_EXEC = 'FileCheck-9.0.1' -def get_filecheck_py_path(): +def get_os_filename_string(): + if platform.system() == 'Windows': + return "Windows" + if platform.system() == 'Darwin': + return "macOS" + if platform.system() == 'Linux': + return "Linux" + assert 0, "error: FileCheck.py could not detect OS" + + +def get_filecheck_py_exec(): + cwd = os.getcwd() + return 'python \\"{cwd}/filecheck/FileCheck.py\\"'.format(cwd=cwd) + + +def get_filecheck_tester_exec(): cwd = os.getcwd() - return "{cwd}/filecheck/FileCheck.py".format(cwd=cwd) + os_string = get_os_filename_string() + + template = '\\"{cwd}/tests/integration/tools/FileCheck/FileCheck-9.0.1-{os_string}\\"' + return template.format(cwd=cwd, os_string=os_string) def get_filecheck_llvm_path(filecheck_exec): cwd = os.getcwd() - exec = "{cwd}/tests/integration/tools/FileCheck/{filecheck_exec}".format(cwd=cwd, filecheck_exec=filecheck_exec) - return exec + os_string = get_os_filename_string() + + template = '\\"{cwd}/tests/integration/tools/FileCheck/{filecheck_exec}-{os_string}\\"' + return template.format( + cwd=cwd, filecheck_exec=filecheck_exec, os_string=os_string + ) def formatted_command(string): @@ -27,17 +50,22 @@ def run_lit_tests(c, filecheck_exec, llvm_only): assert filecheck_exec assert llvm_only is not None - llvm_only_value = "1" if llvm_only else "" - cwd = os.getcwd() + llvm_only_value = "1" if llvm_only else "" + filecheck_tester_exec = get_filecheck_tester_exec() + command = formatted_command(""" lit --param REAL_ONLY={llvm_only_value} - --param FILECHECK_EXEC={filecheck_exec} + --param FILECHECK_EXEC="{filecheck_exec}" + --param FILECHECK_TESTER_EXEC="{filecheck_tester_exec}" -v {cwd}/tests/integration - """).format(cwd=cwd, filecheck_exec=filecheck_exec, llvm_only_value=llvm_only_value) + """).format(cwd=cwd, + filecheck_exec=filecheck_exec, + filecheck_tester_exec=filecheck_tester_exec, + llvm_only_value=llvm_only_value) print(command) c.run("{}".format(command)) @@ -47,7 +75,7 @@ def run_lit_tests(c, filecheck_exec, llvm_only): def test(c): run_lit_tests(c, get_filecheck_llvm_path(FILECHECK_LLVM_8_EXEC), True) run_lit_tests(c, get_filecheck_llvm_path(FILECHECK_LLVM_9_EXEC), True) - run_lit_tests(c, get_filecheck_py_path(), False) + run_lit_tests(c, get_filecheck_py_exec(), False) @task def clean(c): diff --git a/tests/integration/lit.cfg b/tests/integration/lit.cfg index 9363a2c..1fd67b6 100644 --- a/tests/integration/lit.cfg +++ b/tests/integration/lit.cfg @@ -17,10 +17,13 @@ current_dir = os.getcwd() filecheck_exec = lit_config.params['FILECHECK_EXEC'] assert(filecheck_exec) +filecheck_tester_exec = lit_config.params['FILECHECK_TESTER_EXEC'] +assert(filecheck_tester_exec) + real_only = lit_config.params['REAL_ONLY'] config.substitutions.append(('%FILECHECK_EXEC', filecheck_exec)) -config.substitutions.append(('%FILECHECK_TESTER_EXEC', "{}/tests/integration/tools/FileCheck/FileCheck".format(current_dir))) +config.substitutions.append(('%FILECHECK_TESTER_EXEC', filecheck_tester_exec)) cat_exec = "cat" if not is_windows() else "type" config.substitutions.append(('%cat', cat_exec)) diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/01-error_CHECK_EMPTY_without_previous_CHECK/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/01-error_CHECK_EMPTY_without_previous_CHECK/sample.itest index a31c873..b8f13f7 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/01-error_CHECK_EMPTY_without_previous_CHECK/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/01-error_CHECK_EMPTY_without_previous_CHECK/sample.itest @@ -1,5 +1,5 @@ ; RUN: %cat "%S/filecheck.input" | %expect_exit 2 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: {{.*}}filecheck.check:1:3: error: found 'CHECK-EMPTY' without previous 'CHECK: line{{$}} ; CHECK: {{^}}; CHECK-EMPTY:{{$}} ; CHECK: {{^}} ^ diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/02-error_CHECK_EMPTY_negative_match/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/02-error_CHECK_EMPTY_negative_match/sample.itest index 8aa0752..4c55ed3 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/02-error_CHECK_EMPTY_negative_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/02-error_CHECK_EMPTY_negative_match/sample.itest @@ -1,5 +1,5 @@ ; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: {{.*}}filecheck.check:2:15: error: CHECK-EMPTY: expected string not found in input{{$}} ; CHECK: {{^}}; CHECK-EMPTY:{{$}} ; CHECK: {{^}} ^ diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/03-error_valid_but_followed_by_another_failing_check/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/03-error_valid_but_followed_by_another_failing_check/sample.itest index c79d64c..c88d140 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/03-error_valid_but_followed_by_another_failing_check/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/03-error_valid_but_followed_by_another_failing_check/sample.itest @@ -1,4 +1,5 @@ ; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines + ; CHECK:{{.*}}filecheck.check:3:10: error: CHECK: expected string not found in input{{$}} ; CHECK:; CHECK: string2 ; CHECK: ^ diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest index 065502f..daf4f31 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest @@ -1,4 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines ; CHECK:{{.*}}filecheck.check:3:15: error: CHECK-EMPTY: expected string not found in input{{$}} ; CHECK:; CHECK-EMPTY: diff --git a/tests/integration/tools/FileCheck/FileCheck b/tests/integration/tools/FileCheck/FileCheck deleted file mode 100755 index 735c54c..0000000 --- a/tests/integration/tools/FileCheck/FileCheck +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -file_check_path=`echo $(cd $(dirname "$0") && pwd -P)` - -$file_check_path/FileCheck-9.0.1 "$@" diff --git a/tests/integration/tools/FileCheck/FileCheck-8.0.1 b/tests/integration/tools/FileCheck/FileCheck-8.0.1 deleted file mode 100755 index 83589f7..0000000 --- a/tests/integration/tools/FileCheck/FileCheck-8.0.1 +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -file_check_path=`echo $(cd $(dirname "$0") && pwd -P)` - -echo $file_check_path - -if [[ "$OSTYPE" == "linux-gnu" ]]; then - $file_check_path/FileCheck-8.0.1-Linux "$@" -elif [[ "$OSTYPE" == "darwin"* ]]; then - $file_check_path/FileCheck-8.0.1-macOS "$@" -else - exit 1 -fi diff --git a/tests/integration/tools/FileCheck/FileCheck-9.0.1 b/tests/integration/tools/FileCheck/FileCheck-9.0.1 deleted file mode 100755 index b38ce4e..0000000 --- a/tests/integration/tools/FileCheck/FileCheck-9.0.1 +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -file_check_path=`echo $(cd $(dirname "$0") && pwd -P)` - -echo $file_check_path - -if [[ "$OSTYPE" == "linux-gnu" ]]; then - $file_check_path/FileCheck-9.0.1-Linux "$@" -elif [[ "$OSTYPE" == "darwin"* ]]; then - $file_check_path/FileCheck-9.0.1-macOS "$@" -else - exit 1 -fi From a9e8fcce88847099225d43261b178748a217b30c Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Mon, 13 Apr 2020 16:16:31 +0200 Subject: [PATCH 2/2] tests: fix all tests: stop expecting FileCheck path --- filecheck/FileCheck.py | 7 ------- .../sample.itest | 2 +- .../sample.itest | 4 +--- .../sample.itest | 4 +--- .../sample.itest | 3 ++- .../sample.itest | 4 +--- .../sample.itest | 3 ++- .../03-negative_match_regex/sample.itest | 4 ++-- .../positive/01-positive_match/sample.itest | 4 +--- .../sample.itest | 4 +--- .../03-positive_match_regex/sample.itest | 4 +--- .../CHECK.itest | 2 +- .../CHECK.itest-llvm | 1 - .../CHECK.itest-py | 1 - .../sample.itest | 3 ++- .../01-positive_match/sample.itest | 4 +--- .../sample.itest | 3 +-- .../02-positive_match_whitespaces/sample.itest | 4 +--- .../03-positive_regex_match/sample.itest | 4 +--- .../04-escaping_non_regex_parts/sample.itest | 4 +--- .../01-positive_match/sample.itest | 4 +--- .../sample.itest | 4 +--- .../03-negative_match_first_string/sample.itest | 4 ++-- .../sample.itest | 4 ++-- .../sample.itest | 4 ++-- .../sample.itest | 2 +- .../07-negative_match_third_string/sample.itest | 2 +- .../two_strings/01-positive_match/sample.itest | 4 +--- .../sample.itest | 4 +--- .../03-negative_match_first_string/sample.itest | 4 ++-- .../sample.itest | 4 ++-- .../CHECK-EMPTY/Failure/CHECK-EMPTY.itest-py | 1 - .../CHECK-EMPTY/Success/CHECK-EMPTY.itest | 4 +--- .../CHECK-NEXT/Success/CHECK-NEXT.itest | 4 +--- .../CHECK-NOT/Success/CHECK-NOT.itest | 4 +--- .../check-commands/CHECK/Failure/CHECK.itest | 4 ++-- .../check-commands/CHECK/Success/CHECK.itest | 4 +--- .../tests/examples/lit-and-filecheck/01-pass.c | 2 +- .../tests/examples/lit-and-filecheck/02-fail.c | 2 +- .../without--match-full-lines.itest | 4 +--- .../without--strict-whitespace.itest | 8 +++----- .../options/strict-mode/strict-mode.itest | 4 +--- .../01_empty_invocation/sample.itest | 6 +++--- .../02_check_file_does_not_exist/sample.itest | 2 +- .../03_empty_check_file/sample.itest | 2 +- .../sample.itest | 2 +- .../05_one_newline_symbol_input/sample.itest | 4 +--- .../06_empty_input_file/sample.itest | 3 ++- .../--check-prefix/01_positive/sample.itest | 9 +++------ .../--check-prefix/02_negative/sample.itest | 2 +- .../03_malformed_prefix/sample.itest | 2 +- .../tests/options/--help/sample.itest | 2 +- .../01_option_has_no_effect/sample.itest | 4 ++-- .../sample.itest | 8 ++------ .../sample.itest | 5 +---- .../01_string/sample.itest | 5 +---- .../02_regex/sample.itest | 5 +---- .../03_string_negative/sample.itest | 2 +- .../04_regex_negative/sample.itest | 2 +- .../sample.itest | 8 ++------ .../sample.itest | 8 ++------ .../sample.itest | 8 ++------ .../sample.itest | 8 ++------ .../FileCheck-manual/CHECK-EMPTY/sample.itest | 4 +--- .../01-mull-scalar-operator-enum/sample.itest | 4 +--- tests/integration/tools/expect_exit.py | 17 ++++++++++++----- 66 files changed, 96 insertions(+), 176 deletions(-) diff --git a/filecheck/FileCheck.py b/filecheck/FileCheck.py index 8e79a74..5ac41dc 100755 --- a/filecheck/FileCheck.py +++ b/filecheck/FileCheck.py @@ -173,13 +173,6 @@ def check_line(line, current_check, match_full_lines): def main(): - # FileCheck always prints its first argument. - filecheck_path = sys.argv[0] - if os.path.exists(filecheck_path): - filecheck_path = os.path.abspath(filecheck_path) - - print(filecheck_path) - if len(sys.argv) == 1: print(" not specified") exit(2) diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest index daf4f31..f95ea19 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/04-error_valid_but_followed_by_another_2_check_empty/sample.itest @@ -1,4 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines ; CHECK:{{.*}}filecheck.check:3:15: error: CHECK-EMPTY: expected string not found in input{{$}} ; CHECK:; CHECK-EMPTY: diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/05-success_CHECK_EMPTY_after_CHECK/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/05-success_CHECK_EMPTY_after_CHECK/sample.itest index a26dece..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/05-success_CHECK_EMPTY_after_CHECK/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/05-success_CHECK_EMPTY_after_CHECK/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 0) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK-EMPTY/06-success_CHECK_EMPTY_after_CHECK_two_times/sample.itest b/tests/integration/tests/check_commands/CHECK-EMPTY/06-success_CHECK_EMPTY_after_CHECK_two_times/sample.itest index a26dece..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK-EMPTY/06-success_CHECK_EMPTY_after_CHECK_two_times/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-EMPTY/06-success_CHECK_EMPTY_after_CHECK_two_times/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 0) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK-NEXT/03-negative-match-check-next-on-the-first-line-no-match-exist/sample.itest b/tests/integration/tests/check_commands/CHECK-NEXT/03-negative-match-check-next-on-the-first-line-no-match-exist/sample.itest index d12d1a5..66e60a8 100644 --- a/tests/integration/tests/check_commands/CHECK-NEXT/03-negative-match-check-next-on-the-first-line-no-match-exist/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NEXT/03-negative-match-check-next-on-the-first-line-no-match-exist/sample.itest @@ -1,4 +1,5 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 2;) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 2 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines + ; CHECK:{{^.*}}filecheck.check:1:4: error: found 'CHECK-NEXT' without previous 'CHECK: line{{$}} ; CHECK:// CHECK-NEXT: 2 ; CHECK: ^ diff --git a/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/sample.itest b/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/sample.itest index d986088..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 0;) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/06-multiple-CHECK-NOT-all-have-effect/sample.itest b/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/06-multiple-CHECK-NOT-all-have-effect/sample.itest index 2706cff..d909693 100644 --- a/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/06-multiple-CHECK-NOT-all-have-effect/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NOT/multiple_strings/06-multiple-CHECK-NOT-all-have-effect/sample.itest @@ -1,4 +1,5 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines + ; CHECK:; CHECK-NOT:warning ; CHECK: ^ ; CHECK::2:1: note: found here diff --git a/tests/integration/tests/check_commands/CHECK-NOT/one_string/negative/03-negative_match_regex/sample.itest b/tests/integration/tests/check_commands/CHECK-NOT/one_string/negative/03-negative_match_regex/sample.itest index 0799052..377460c 100644 --- a/tests/integration/tests/check_commands/CHECK-NOT/one_string/negative/03-negative_match_regex/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NOT/one_string/negative/03-negative_match_regex/sample.itest @@ -1,6 +1,6 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? == 1;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-NEXT: {{^.*}}filecheck.check:1:14: error: CHECK-NOT: excluded string found in input{{$}} + +; CHECK: {{^.*}}filecheck.check:1:14: error: CHECK-NOT: excluded string found in input{{$}} ; TODO: Here we could do a better match. ; CHECK-NEXT: {{^; CHECK-NOT: ...h.l.o...$}} ; TODO: Real FileCheck ignores whitespaces even when regex is passed. diff --git a/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/01-positive_match/sample.itest b/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/01-positive_match/sample.itest index 80742c0..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/01-positive_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/01-positive_match/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? == 0;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/02-positive_check_effective_only_one_line_before_next_check/sample.itest b/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/02-positive_check_effective_only_one_line_before_next_check/sample.itest index 80742c0..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/02-positive_check_effective_only_one_line_before_next_check/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/02-positive_check_effective_only_one_line_before_next_check/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? == 0;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/03-positive_match_regex/sample.itest b/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/03-positive_match_regex/sample.itest index 80742c0..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/03-positive_match_regex/sample.itest +++ b/tests/integration/tests/check_commands/CHECK-NOT/one_string/positive/03-positive_match_regex/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? == 0;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/failure/09-not-enough-input-for-all-checks/CHECK.itest b/tests/integration/tests/check_commands/CHECK/failure/09-not-enough-input-for-all-checks/CHECK.itest index b663d3a..477baee 100644 --- a/tests/integration/tests/check_commands/CHECK/failure/09-not-enough-input-for-all-checks/CHECK.itest +++ b/tests/integration/tests/check_commands/CHECK/failure/09-not-enough-input-for-all-checks/CHECK.itest @@ -1,4 +1,4 @@ -; RUN: printf "String1" | (%FILECHECK_EXEC "%S/CHECK.check" 2>&1; test $? = 1;) | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: printf "String1" | %expect_exit 1 %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines // TODO: Something wrong with the greediness here: ; CHECK***:{{^.*}}CHECK.check:2:8: error: CHECK***: expected string not found in input diff --git a/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-llvm b/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-llvm index 6e050f8..71de4c3 100644 --- a/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-llvm +++ b/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-llvm @@ -1,5 +1,4 @@ ; RUN: printf "String1\n" | (%FILECHECK_EXEC %S/CHECK.check 2>&1; test $? = 1;) | %FILECHECK_EXEC %s -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} ; CHECK: {{.*}}CHECK.check:2:8: error: CHECK: expected string not found in input ; CHECK: CHECK: String2 ; CHECK: ^ diff --git a/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-py b/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-py index 7df72cd..d358fdc 100644 --- a/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-py +++ b/tests/integration/tests/check_commands/CHECK/failure/10-edge-case-no-newline-in-py/CHECK.itest-py @@ -1,5 +1,4 @@ ; RUN: printf "String1\n" | (%FILECHECK_EXEC %S/CHECK.check 2>&1; test $? = 1;) | %FILECHECK_EXEC %s --strict-whitespace --match-full-lines -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} // TODO: Something wrong with the greediness here: ; CHECK***:{{^.*}}CHECK.check:2:8: error: CHECK***: expected string not found in input ; CHECK:{{^.*}} diff --git a/tests/integration/tests/check_commands/CHECK/one_string/negative-match/03-negative_regex_match_spaces_before_string/sample.itest b/tests/integration/tests/check_commands/CHECK/one_string/negative-match/03-negative_regex_match_spaces_before_string/sample.itest index 5c64dd2..e453e4d 100644 --- a/tests/integration/tests/check_commands/CHECK/one_string/negative-match/03-negative_regex_match_spaces_before_string/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/one_string/negative-match/03-negative_regex_match_spaces_before_string/sample.itest @@ -1,4 +1,5 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines + ; CHECK:{{.*}}filecheck.check:1:10: error: CHECK: expected string not found in input{{$}} ; CHECK-NEXT:{{^; CHECK: .....hello.....$}} ; CHECK-NEXT:{{^ \^$}} diff --git a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/01-positive_match/sample.itest b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/01-positive_match/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/01-positive_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/01-positive_match/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_check_without_preceeding_semicolon/sample.itest b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_check_without_preceeding_semicolon/sample.itest index 87a1fb1..6277143 100644 --- a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_check_without_preceeding_semicolon/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_check_without_preceeding_semicolon/sample.itest @@ -1,2 +1 @@ -; RUN: printf "hello" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} +; RUN: printf "hello" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_whitespaces/sample.itest b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_whitespaces/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_whitespaces/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/02-positive_match_whitespaces/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/03-positive_regex_match/sample.itest b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/03-positive_regex_match/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/03-positive_regex_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/03-positive_regex_match/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/04-escaping_non_regex_parts/sample.itest b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/04-escaping_non_regex_parts/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/one_string/positive-match/04-escaping_non_regex_parts/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/one_string/positive-match/04-escaping_non_regex_parts/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/01-positive_match/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/01-positive_match/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/01-positive_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/01-positive_match/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/02-positive_match-one-line-between/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/02-positive_match-one-line-between/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/02-positive_match-one-line-between/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/02-positive_match-one-line-between/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/03-negative_match_first_string/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/03-negative_match_first_string/sample.itest index 4eadc65..193391a 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/03-negative_match_first_string/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/03-negative_match_first_string/sample.itest @@ -1,6 +1,6 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-NEXT: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} + +; CHECK: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} ; CHECK-NEXT: {{^}}; CHECK: foo{{$}} ; CHECK-NEXT: {{^}} ^{{$}} ; CHECK-NEXT: {{^:.*:.*: note: scanning from here$}} diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/04-negative_match_first_string_scanning_for_the_best_match/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/04-negative_match_first_string_scanning_for_the_best_match/sample.itest index e34d19c..7f1b76c 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/04-negative_match_first_string_scanning_for_the_best_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/04-negative_match_first_string_scanning_for_the_best_match/sample.itest @@ -1,6 +1,6 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-NEXT: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} + +; CHECK: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} ; CHECK-NEXT: {{^}}; CHECK: foo{{$}} ; CHECK-NEXT: {{^}} ^{{$}} ; CHECK-NEXT: {{^:.*:.*: note: scanning from here$}} diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/05-negative_match_first_string_no_best_match/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/05-negative_match_first_string_no_best_match/sample.itest index 041a771..25f6015 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/05-negative_match_first_string_no_best_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/05-negative_match_first_string_no_best_match/sample.itest @@ -1,6 +1,6 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-NEXT: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} + +; CHECK: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} ; CHECK-NEXT: {{^}}; CHECK: foo{{$}} ; CHECK-NEXT: {{^}} ^{{$}} ; CHECK-NEXT: {{^:.*:.*: note: scanning from here$}} diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/06-negative_match_second_string/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/06-negative_match_second_string/sample.itest index 2c40249..aa734cd 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/06-negative_match_second_string/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/06-negative_match_second_string/sample.itest @@ -1,5 +1,5 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1 || true) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: {{.*filecheck.check:2:10: error: CHECK: expected string not found in input$}} ; CHECK: {{^}}; CHECK: foo{{$}} ; CHECK: {{^}} ^{{$}} diff --git a/tests/integration/tests/check_commands/CHECK/three_strings/07-negative_match_third_string/sample.itest b/tests/integration/tests/check_commands/CHECK/three_strings/07-negative_match_third_string/sample.itest index a080fa6..7b16b04 100644 --- a/tests/integration/tests/check_commands/CHECK/three_strings/07-negative_match_third_string/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/three_strings/07-negative_match_third_string/sample.itest @@ -1,5 +1,5 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1 || true) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: {{.*filecheck.check:3:10: error: CHECK: expected string not found in input$}} ; CHECK: {{^}}; CHECK: foo{{$}} ; CHECK: {{^}} ^{{$}} diff --git a/tests/integration/tests/check_commands/CHECK/two_strings/01-positive_match/sample.itest b/tests/integration/tests/check_commands/CHECK/two_strings/01-positive_match/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/two_strings/01-positive_match/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/two_strings/01-positive_match/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/two_strings/02-positive_match-one-line-between/sample.itest b/tests/integration/tests/check_commands/CHECK/two_strings/02-positive_match-one-line-between/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/check_commands/CHECK/two_strings/02-positive_match-one-line-between/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/two_strings/02-positive_match-one-line-between/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/check_commands/CHECK/two_strings/03-negative_match_first_string/sample.itest b/tests/integration/tests/check_commands/CHECK/two_strings/03-negative_match_first_string/sample.itest index 4eadc65..193391a 100644 --- a/tests/integration/tests/check_commands/CHECK/two_strings/03-negative_match_first_string/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/two_strings/03-negative_match_first_string/sample.itest @@ -1,6 +1,6 @@ ; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-NEXT: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} + +; CHECK: {{.*filecheck.check:1:.*: error: CHECK: expected string not found in input$}} ; CHECK-NEXT: {{^}}; CHECK: foo{{$}} ; CHECK-NEXT: {{^}} ^{{$}} ; CHECK-NEXT: {{^:.*:.*: note: scanning from here$}} diff --git a/tests/integration/tests/check_commands/CHECK/two_strings/04-negative_match_second_string/sample.itest b/tests/integration/tests/check_commands/CHECK/two_strings/04-negative_match_second_string/sample.itest index 2c40249..69ca0ac 100644 --- a/tests/integration/tests/check_commands/CHECK/two_strings/04-negative_match_second_string/sample.itest +++ b/tests/integration/tests/check_commands/CHECK/two_strings/04-negative_match_second_string/sample.itest @@ -1,5 +1,5 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1 || true) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines + ; CHECK: {{.*filecheck.check:2:10: error: CHECK: expected string not found in input$}} ; CHECK: {{^}}; CHECK: foo{{$}} ; CHECK: {{^}} ^{{$}} diff --git a/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Failure/CHECK-EMPTY.itest-py b/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Failure/CHECK-EMPTY.itest-py index ffe96fe..636d6f8 100644 --- a/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Failure/CHECK-EMPTY.itest-py +++ b/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Failure/CHECK-EMPTY.itest-py @@ -1,5 +1,4 @@ ; RUN: printf "String1\nString2" | (%FILECHECK_EXEC %S/CHECK-EMPTY.check 2>&1; test $? = 1) | %FILECHECK_EXEC %s -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} ; CHECK: {{^.*}}CHECK-EMPTY.check:2:13: error: CHECK-EMPTY: expected string not found in input ; CHECK: CHECK-EMPTY: ; CHECK: ^ diff --git a/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Success/CHECK-EMPTY.itest b/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Success/CHECK-EMPTY.itest index 56932f2..0f6a3ed 100644 --- a/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Success/CHECK-EMPTY.itest +++ b/tests/integration/tests/examples/check-commands/CHECK-EMPTY/Success/CHECK-EMPTY.itest @@ -1,3 +1 @@ -; RUN: printf "String1\n\nString2" | %FILECHECK_EXEC %S/CHECK-EMPTY.check | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String1\n\nString2" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/CHECK-EMPTY.check diff --git a/tests/integration/tests/examples/check-commands/CHECK-NEXT/Success/CHECK-NEXT.itest b/tests/integration/tests/examples/check-commands/CHECK-NEXT/Success/CHECK-NEXT.itest index 5675101..6707ce4 100644 --- a/tests/integration/tests/examples/check-commands/CHECK-NEXT/Success/CHECK-NEXT.itest +++ b/tests/integration/tests/examples/check-commands/CHECK-NEXT/Success/CHECK-NEXT.itest @@ -1,3 +1 @@ -; RUN: printf "String1\nString2" | %FILECHECK_EXEC %S/CHECK-NEXT.check | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String1\nString2" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/CHECK-NEXT.check diff --git a/tests/integration/tests/examples/check-commands/CHECK-NOT/Success/CHECK-NOT.itest b/tests/integration/tests/examples/check-commands/CHECK-NOT/Success/CHECK-NOT.itest index c985f92..32c93ab 100644 --- a/tests/integration/tests/examples/check-commands/CHECK-NOT/Success/CHECK-NOT.itest +++ b/tests/integration/tests/examples/check-commands/CHECK-NOT/Success/CHECK-NOT.itest @@ -1,3 +1 @@ -; RUN: printf "String4" | %FILECHECK_EXEC %S/CHECK-NOT.check | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String4" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/CHECK-NOT.check diff --git a/tests/integration/tests/examples/check-commands/CHECK/Failure/CHECK.itest b/tests/integration/tests/examples/check-commands/CHECK/Failure/CHECK.itest index 37c9849..a3333b3 100644 --- a/tests/integration/tests/examples/check-commands/CHECK/Failure/CHECK.itest +++ b/tests/integration/tests/examples/check-commands/CHECK/Failure/CHECK.itest @@ -1,5 +1,5 @@ -; RUN: printf "String1" | (%FILECHECK_EXEC "%S/CHECK.check" 2>&1; test $? = 1;) | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} +; RUN: printf "String1" | %expect_exit 1 %FILECHECK_EXEC %S/CHECK.check | %FILECHECK_EXEC %s + ; CHECK: {{.*}}CHECK.check:2:8: error: CHECK: expected string not found in input ; CHECK: CHECK: String2 ; CHECK: ^ diff --git a/tests/integration/tests/examples/check-commands/CHECK/Success/CHECK.itest b/tests/integration/tests/examples/check-commands/CHECK/Success/CHECK.itest index 2cbdecc..4fc00c7 100644 --- a/tests/integration/tests/examples/check-commands/CHECK/Success/CHECK.itest +++ b/tests/integration/tests/examples/check-commands/CHECK/Success/CHECK.itest @@ -1,3 +1 @@ -; RUN: printf "String1\nString2\nString3" | %FILECHECK_EXEC "%S/CHECK.check" | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String1\nString2\nString3" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/CHECK.check diff --git a/tests/integration/tests/examples/lit-and-filecheck/01-pass.c b/tests/integration/tests/examples/lit-and-filecheck/01-pass.c index d9eb8c5..0961498 100644 --- a/tests/integration/tests/examples/lit-and-filecheck/01-pass.c +++ b/tests/integration/tests/examples/lit-and-filecheck/01-pass.c @@ -1,5 +1,5 @@ /** -; RUN: gcc %s -o %S/hello-world-1 && %S/hello-world-1 | filecheck %s +; RUN: gcc "%s" -o %S/hello-world-1 && %S/hello-world-1 | filecheck %s ; CHECK: Hello world */ diff --git a/tests/integration/tests/examples/lit-and-filecheck/02-fail.c b/tests/integration/tests/examples/lit-and-filecheck/02-fail.c index 02ff6b1..8696a6e 100644 --- a/tests/integration/tests/examples/lit-and-filecheck/02-fail.c +++ b/tests/integration/tests/examples/lit-and-filecheck/02-fail.c @@ -1,5 +1,5 @@ /** -; RUN: gcc %s -o %S/hello-world-2 && %S/hello-world-2 | filecheck %s; test $? = 1 +; RUN: gcc "%s" -o %S/hello-world-2 && %S/hello-world-2 | filecheck %s; test $? = 1 ; CHECK: Wrong line */ diff --git a/tests/integration/tests/examples/options/--match-full-lines/without--match-full-lines.itest b/tests/integration/tests/examples/options/--match-full-lines/without--match-full-lines.itest index 7053084..cbfad6a 100644 --- a/tests/integration/tests/examples/options/--match-full-lines/without--match-full-lines.itest +++ b/tests/integration/tests/examples/options/--match-full-lines/without--match-full-lines.itest @@ -1,3 +1 @@ -; RUN: printf "String1\nString2\nString3" | %FILECHECK_EXEC %S/without--match-full-lines.check | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String1\nString2\nString3" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/without--match-full-lines.check" diff --git a/tests/integration/tests/examples/options/--strict-whitespace/without--strict-whitespace.itest b/tests/integration/tests/examples/options/--strict-whitespace/without--strict-whitespace.itest index c485164..34aa526 100644 --- a/tests/integration/tests/examples/options/--strict-whitespace/without--strict-whitespace.itest +++ b/tests/integration/tests/examples/options/--strict-whitespace/without--strict-whitespace.itest @@ -1,5 +1,3 @@ -; RUN: printf "String1 String2 String3" | %FILECHECK_EXEC %S/without--strict-whitespace.check | %FILECHECK_EXEC "%s" -; RUN: printf "String1 String2 String3" | %FILECHECK_EXEC %S/without--strict-whitespace.check | %FILECHECK_EXEC "%s" -; RUN: printf " String1\tString2\t\t\tString3 " | %FILECHECK_EXEC %S/without--strict-whitespace.check | %FILECHECK_EXEC "%s" -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String1 String2 String3" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/without--strict-whitespace.check +; RUN: printf "String1 String2 String3" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/without--strict-whitespace.check +; RUN: printf " String1\tString2\t\t\tString3 " | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/without--strict-whitespace.check diff --git a/tests/integration/tests/examples/options/strict-mode/strict-mode.itest b/tests/integration/tests/examples/options/strict-mode/strict-mode.itest index 8d9881f..0a2aaac 100644 --- a/tests/integration/tests/examples/options/strict-mode/strict-mode.itest +++ b/tests/integration/tests/examples/options/strict-mode/strict-mode.itest @@ -1,3 +1 @@ -; RUN: printf "String1\nString2\nString3" | %FILECHECK_EXEC %S/strict-mode.check --strict-whitespace --match-full-lines | %FILECHECK_EXEC "%s" --strict-whitespace --match-full-lines -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: printf "String1\nString2\nString3" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC %S/strict-mode.check --strict-whitespace --match-full-lines diff --git a/tests/integration/tests/invalid_input/01_empty_invocation/sample.itest b/tests/integration/tests/invalid_input/01_empty_invocation/sample.itest index 0c7b65c..7ddf1fc 100644 --- a/tests/integration/tests/invalid_input/01_empty_invocation/sample.itest +++ b/tests/integration/tests/invalid_input/01_empty_invocation/sample.itest @@ -1,3 +1,3 @@ -; RUN: (%FILECHECK_EXEC 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-NEXT: not specified +; RUN: %expect_exit 2 %FILECHECK_EXEC | %FILECHECK_TESTER_EXEC "%s" --match-full-lines + +; CHECK: not specified diff --git a/tests/integration/tests/invalid_input/02_check_file_does_not_exist/sample.itest b/tests/integration/tests/invalid_input/02_check_file_does_not_exist/sample.itest index 1afca73..4e5e2cd 100644 --- a/tests/integration/tests/invalid_input/02_check_file_does_not_exist/sample.itest +++ b/tests/integration/tests/invalid_input/02_check_file_does_not_exist/sample.itest @@ -1,4 +1,4 @@ ; RUN: (%FILECHECK_EXEC file/does/not/exist 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: Could not open check file 'file/does/not/exist': No such file or directory ; CHECK-EMPTY: diff --git a/tests/integration/tests/invalid_input/03_empty_check_file/sample.itest b/tests/integration/tests/invalid_input/03_empty_check_file/sample.itest index d5af1cb..9953f56 100644 --- a/tests/integration/tests/invalid_input/03_empty_check_file/sample.itest +++ b/tests/integration/tests/invalid_input/03_empty_check_file/sample.itest @@ -1,4 +1,4 @@ ; RUN: printf "" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: error: no check strings found with prefix 'CHECK:' ; CHECK-EMPTY diff --git a/tests/integration/tests/invalid_input/04_nonempty_check_file_but_no_checks/sample.itest b/tests/integration/tests/invalid_input/04_nonempty_check_file_but_no_checks/sample.itest index d5af1cb..9953f56 100644 --- a/tests/integration/tests/invalid_input/04_nonempty_check_file_but_no_checks/sample.itest +++ b/tests/integration/tests/invalid_input/04_nonempty_check_file_but_no_checks/sample.itest @@ -1,4 +1,4 @@ ; RUN: printf "" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} + ; CHECK: error: no check strings found with prefix 'CHECK:' ; CHECK-EMPTY diff --git a/tests/integration/tests/invalid_input/05_one_newline_symbol_input/sample.itest b/tests/integration/tests/invalid_input/05_one_newline_symbol_input/sample.itest index f9fa870..04fd9b2 100644 --- a/tests/integration/tests/invalid_input/05_one_newline_symbol_input/sample.itest +++ b/tests/integration/tests/invalid_input/05_one_newline_symbol_input/sample.itest @@ -1,3 +1 @@ -; RUN: printf "\n" | %FILECHECK_EXEC "%S/filecheck.check" 2>&1 | %FILECHECK_TESTER_EXEC "%s" -; CHECK: {{.*}}FileCheck -; CHECK-EMPTY: +; RUN: printf "\n" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" 2>&1 diff --git a/tests/integration/tests/invalid_input/06_empty_input_file/sample.itest b/tests/integration/tests/invalid_input/06_empty_input_file/sample.itest index d0da6fd..2ac3294 100644 --- a/tests/integration/tests/invalid_input/06_empty_input_file/sample.itest +++ b/tests/integration/tests/invalid_input/06_empty_input_file/sample.itest @@ -1,3 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" +; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC %s + ; CHECK: FileCheck error: '-' is empty. ; CHECK: FileCheck command line: {{.*}}.check{{$}} diff --git a/tests/integration/tests/options/--check-prefix/01_positive/sample.itest b/tests/integration/tests/options/--check-prefix/01_positive/sample.itest index ded0e68..feec768 100644 --- a/tests/integration/tests/options/--check-prefix/01_positive/sample.itest +++ b/tests/integration/tests/options/--check-prefix/01_positive/sample.itest @@ -1,6 +1,3 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" --check-prefix STRING1 | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" --check-prefix STRING2 | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" --check-prefix STRING3 | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines - -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --check-prefix STRING1 +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --check-prefix STRING2 +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --check-prefix STRING3 diff --git a/tests/integration/tests/options/--check-prefix/02_negative/sample.itest b/tests/integration/tests/options/--check-prefix/02_negative/sample.itest index bdcb824..2a81b7b 100644 --- a/tests/integration/tests/options/--check-prefix/02_negative/sample.itest +++ b/tests/integration/tests/options/--check-prefix/02_negative/sample.itest @@ -1,4 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --check-prefix FOO 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 2 %FILECHECK_EXEC "%S/filecheck.check" --check-prefix FOO | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines ; CHECK:error: no check strings found with prefix 'FOO:' ; CHECK-EMPTY: diff --git a/tests/integration/tests/options/--check-prefix/03_malformed_prefix/sample.itest b/tests/integration/tests/options/--check-prefix/03_malformed_prefix/sample.itest index 0fc2974..e773f87 100644 --- a/tests/integration/tests/options/--check-prefix/03_malformed_prefix/sample.itest +++ b/tests/integration/tests/options/--check-prefix/03_malformed_prefix/sample.itest @@ -1,4 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --check-prefix "GARBAGE1.23.4.2" 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %cat "%S/filecheck.input" | %expect_exit 2 %FILECHECK_EXEC "%S/filecheck.check" --check-prefix "GARBAGE1.23.4.2" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines ; CHECK:Supplied check-prefix is invalid! Prefixes must be unique and start with a letter and contain only alphanumeric characters, hyphens and underscores ; CHECK-EMPTY: diff --git a/tests/integration/tests/options/--help/sample.itest b/tests/integration/tests/options/--help/sample.itest index 5ae9ed0..f4ed767 100644 --- a/tests/integration/tests/options/--help/sample.itest +++ b/tests/integration/tests/options/--help/sample.itest @@ -1,4 +1,4 @@ -; RUN: (%FILECHECK_EXEC --help 2>&1; test $? = 0) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines +; RUN: %expect_exit 0 %FILECHECK_EXEC --help | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines ; CHECK:{{^USAGE: [Ff]ile[Cc]heck.* \[options\] $}} ; CHECK-EMPTY: diff --git a/tests/integration/tests/options/--match-full-lines/CHECK-NOT/01_option_has_no_effect/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK-NOT/01_option_has_no_effect/sample.itest index ef3f68e..35fa95e 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK-NOT/01_option_has_no_effect/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK-NOT/01_option_has_no_effect/sample.itest @@ -1,5 +1,5 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --match-full-lines 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC %s --match-full-lines --strict-whitespace +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines | %FILECHECK_TESTER_EXEC %s --match-full-lines --strict-whitespace ; CHECK:{{^.*}}filecheck.check:1:14: error: CHECK-NOT: excluded string found in input{{$}} ; CHECK:; CHECK-NOT: hello world diff --git a/tests/integration/tests/options/--match-full-lines/CHECK/01_matching_substring_is_rejected_when_full_match_enabled/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK/01_matching_substring_is_rejected_when_full_match_enabled/sample.itest index c73228a..e3266b7 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK/01_matching_substring_is_rejected_when_full_match_enabled/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK/01_matching_substring_is_rejected_when_full_match_enabled/sample.itest @@ -1,10 +1,6 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=NO_OPTION -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --match-full-lines 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace -check-prefix=OPTION +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace -check-prefix=OPTION -; NO_OPTION: {{^.*}}FileCheck{{(\.py)?$}} -; NO_OPTION-EMPTY: - -; OPTION:{{^.*}}FileCheck{{(\.py)?$}} ; OPTION:{{^.*}}filecheck.check:1:10: error: CHECK: expected string not found in input{{$}} ; OPTION:; CHECK: hello world ; OPTION: ^ diff --git a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/01_when_no_strict_whitespace_then_leading_whitespace_is_ignored/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/01_when_no_strict_whitespace_then_leading_whitespace_is_ignored/sample.itest index 148cd28..631a0c2 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/01_when_no_strict_whitespace_then_leading_whitespace_is_ignored/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/01_when_no_strict_whitespace_then_leading_whitespace_is_ignored/sample.itest @@ -1,4 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace - -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines diff --git a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/01_string/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/01_string/sample.itest index a43bf98..3682be0 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/01_string/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/01_string/sample.itest @@ -1,4 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace 2>&1; test $? = 0;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace - -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace diff --git a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/02_regex/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/02_regex/sample.itest index a43bf98..8287e73 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/02_regex/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/02_regex/sample.itest @@ -1,4 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace 2>&1; test $? = 0;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace - -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace diff --git a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/03_string_negative/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/03_string_negative/sample.itest index 69ff7ef..c48f704 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/03_string_negative/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/03_string_negative/sample.itest @@ -1,4 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace ; TODO: Is this FileCheck bug? (caret is -1 wrong and therefore position is either 9 or 10) ; CHECK:{{^.*filecheck.check:1:(9|10): error: CHECK: expected string not found in input$}} diff --git a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/04_regex_negative/sample.itest b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/04_regex_negative/sample.itest index c7737cf..0acc88c 100644 --- a/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/04_regex_negative/sample.itest +++ b/tests/integration/tests/options/--match-full-lines/CHECK/02_when_strict_whitespace_is_also_specified/02_when_strict_whitespace_then_leading_whitespace_is_not_ignored/04_regex_negative/sample.itest @@ -1,4 +1,4 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --match-full-lines --strict-whitespace | %FILECHECK_TESTER_EXEC "%s" --match-full-lines --strict-whitespace ; TODO: Is this FileCheck bug? (caret is -1 wrong and therefore position is either 9 or 10) ; CHECK:{{^.*filecheck.check:1:(9|10): error: CHECK: expected string not found in input$}} diff --git a/tests/integration/tests/options/--strict-whitespace/CHECK/01_input_has_mixed_spaces_and_tabs/sample.itest b/tests/integration/tests/options/--strict-whitespace/CHECK/01_input_has_mixed_spaces_and_tabs/sample.itest index 4f8df8d..f18b5f3 100644 --- a/tests/integration/tests/options/--strict-whitespace/CHECK/01_input_has_mixed_spaces_and_tabs/sample.itest +++ b/tests/integration/tests/options/--strict-whitespace/CHECK/01_input_has_mixed_spaces_and_tabs/sample.itest @@ -1,10 +1,6 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=NO_OPTION -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=OPTION +; RUN: cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" +; RUN: cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=OPTION -; NO_OPTION: {{^.*}}FileCheck{{(\.py)?$}} -; NO_OPTION-EMPTY: - -; OPTION: {{^.*}}FileCheck{{(\.py)?$}} ; OPTION: {{^.*}}filecheck.check:1:10: error: CHECK: expected string not found in input{{$}} ; OPTION: ; CHECK: hello world hello world ; OPTION: ^ diff --git a/tests/integration/tests/options/--strict-whitespace/CHECK/02_check_has_mixed_spaces_and_tabs/sample.itest b/tests/integration/tests/options/--strict-whitespace/CHECK/02_check_has_mixed_spaces_and_tabs/sample.itest index ecd2e2c..6b705db 100644 --- a/tests/integration/tests/options/--strict-whitespace/CHECK/02_check_has_mixed_spaces_and_tabs/sample.itest +++ b/tests/integration/tests/options/--strict-whitespace/CHECK/02_check_has_mixed_spaces_and_tabs/sample.itest @@ -1,10 +1,6 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=NO_OPTION -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -check-prefix=OPTION +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -check-prefix=OPTION -; NO_OPTION: {{^.*}}FileCheck{{(\.py)?$}} -; NO_OPTION-EMPTY: - -; OPTION:{{^.*}}FileCheck{{(\.py)?$}} ; OPTION:{{^.*}}filecheck.check:1:10: error: CHECK: expected string not found in input{{$}} ; OPTION:; CHECK: hello world hello world ; OPTION: ^ diff --git a/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/01_input_has_mixed_spaces_and_tabs/sample.itest b/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/01_input_has_mixed_spaces_and_tabs/sample.itest index 7859fb1..b7c9e99 100644 --- a/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/01_input_has_mixed_spaces_and_tabs/sample.itest +++ b/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/01_input_has_mixed_spaces_and_tabs/sample.itest @@ -1,7 +1,6 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -check-prefix=NO_OPTION -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace 2>&1; test $? = 0) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=OPTION +; RUN: %cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -check-prefix=NO_OPTION +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace -; NO_OPTION:{{^.*}}FileCheck{{(\.py)?$}} ; NO_OPTION:{{^.*}}filecheck.check:1:14: error: CHECK-NOT: excluded string found in input{{$}} ; NO_OPTION:; CHECK-NOT: hello world hello world ; NO_OPTION: ^ @@ -9,6 +8,3 @@ ; NO_OPTION:hello world hello world ; NO_OPTION:^~~~~~~~~~~~~~~~~~~~~~~ ; NO_OPTION-EMPTY: - -; OPTION: {{^.*}}FileCheck{{(\.py)?$}} -; OPTION-EMPTY: diff --git a/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/02_check_has_mixed_spaces_and_tabs/sample.itest b/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/02_check_has_mixed_spaces_and_tabs/sample.itest index ecd2e2c..fc61274 100644 --- a/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/02_check_has_mixed_spaces_and_tabs/sample.itest +++ b/tests/integration/tests/options/--strict-whitespace/CHECK_NOT/02_check_has_mixed_spaces_and_tabs/sample.itest @@ -1,10 +1,6 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -check-prefix=NO_OPTION -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace 2>&1; test $? = 1) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -check-prefix=OPTION +; RUN: cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" +; RUN: cat "%S/filecheck.input" | %expect_exit 1 %FILECHECK_EXEC "%S/filecheck.check" --strict-whitespace | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -check-prefix=OPTION -; NO_OPTION: {{^.*}}FileCheck{{(\.py)?$}} -; NO_OPTION-EMPTY: - -; OPTION:{{^.*}}FileCheck{{(\.py)?$}} ; OPTION:{{^.*}}filecheck.check:1:10: error: CHECK: expected string not found in input{{$}} ; OPTION:; CHECK: hello world hello world ; OPTION: ^ diff --git a/tests/integration/tests/real_world_samples/FileCheck-manual/CHECK-EMPTY/sample.itest b/tests/integration/tests/real_world_samples/FileCheck-manual/CHECK-EMPTY/sample.itest index 6ef16d8..ed5ddc6 100644 --- a/tests/integration/tests/real_world_samples/FileCheck-manual/CHECK-EMPTY/sample.itest +++ b/tests/integration/tests/real_world_samples/FileCheck-manual/CHECK-EMPTY/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines -; CHECK: {{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tests/real_world_samples/mull/01-mull-scalar-operator-enum/sample.itest b/tests/integration/tests/real_world_samples/mull/01-mull-scalar-operator-enum/sample.itest index d986088..ed5ddc6 100644 --- a/tests/integration/tests/real_world_samples/mull/01-mull-scalar-operator-enum/sample.itest +++ b/tests/integration/tests/real_world_samples/mull/01-mull-scalar-operator-enum/sample.itest @@ -1,3 +1 @@ -; RUN: %cat "%S/filecheck.input" | (%FILECHECK_EXEC "%S/filecheck.check" 2>&1; test $? = 0;) | %FILECHECK_TESTER_EXEC "%s" --strict-whitespace --match-full-lines -; CHECK:{{^.*}}FileCheck{{(\.py)?$}} -; CHECK-EMPTY: +; RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check" diff --git a/tests/integration/tools/expect_exit.py b/tests/integration/tools/expect_exit.py index 09a03bf..6176367 100644 --- a/tests/integration/tools/expect_exit.py +++ b/tests/integration/tools/expect_exit.py @@ -15,13 +15,16 @@ .format(expected_exit_code_arg)) exit(1) -data = sys.stdin.readlines() - args = sys.argv.copy() args.pop(0) args.pop(0) +expect_no_content = False +if args[0] == '--expect-no-content': + expect_no_content = True + args.pop(0) + # To capture the output from the subprocess we set up stderr to be written to # stdout. This ensures that we see the output from the subprocess in the same # order as we do in a shell however this does not allow us to capture what is @@ -30,10 +33,12 @@ stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) -for line in data: - process.stdin.write(line.encode()) -stdout, stderr = process.communicate() +stdout, _ = process.communicate(input=sys.stdin.buffer.read()) + +if len(stdout) > 0 and expect_no_content: + print("error: expect_exit: expected no content but received: {}".format(stdout)) + exit(1) output_lines = stdout.decode('utf-8').splitlines() for word in output_lines: @@ -42,4 +47,6 @@ if process.returncode == expected_exit_code: exit(0) else: + print("error: expect_exit: expected exit code {} but received: {}" + .format(expected_exit_code, process.returncode)) exit(1)