Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions filecheck/FileCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<check-file> not specified")
exit(2)
Expand Down
46 changes: 37 additions & 9 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import platform
import re

from invoke import task
Expand All @@ -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):
Expand All @@ -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))
Expand All @@ -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):
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^}} ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^}} ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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: ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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: ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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:<stdin>:2:1: note: found here
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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: ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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:{{^.*}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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:{{^ \^$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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: {{^<stdin>:.*:.*: note: scanning from here$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^<stdin>:.*:.*: note: scanning from here$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^<stdin>:.*:.*: note: scanning from here$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^}} ^{{$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^}} ^{{$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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: {{^<stdin>:.*:.*: note: scanning from here$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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: {{^}} ^{{$}}
Expand Down
Original file line number Diff line number Diff line change
@@ -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: ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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: ^
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: (%FILECHECK_EXEC 2>&1; test $? = 2) | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-NEXT: <check-file> not specified
; RUN: %expect_exit 2 %FILECHECK_EXEC | %FILECHECK_TESTER_EXEC "%s" --match-full-lines

; CHECK: <check-file> not specified
Original file line number Diff line number Diff line change
@@ -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:
Loading