Skip to content

Commit

Permalink
Merge pull request #116 from stanislaw/cat-vs-type
Browse files Browse the repository at this point in the history
 lit: introduce %cat to abstract the difference cat vs type
  • Loading branch information
stanislaw authored Apr 12, 2020
2 parents 3c1c30d + c661792 commit 142be2d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.venv
__pycache__
*.egg-info
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import os

import lit.formats


def is_windows():
return os.name == 'nt'


config.name = "FileCheck.py integration tests"
config.test_format = lit.formats.ShTest("0")

Expand All @@ -17,6 +22,9 @@ 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)))

cat_exec = "cat" if not is_windows() else "type"
config.substitutions.append(('%cat', cat_exec))

if real_only:
config.suffixes = ['.itest', '.itest-llvm', '.c']
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: cat %S/filecheck.input | %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC %s --match-full-lines
; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-EMPTY:
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: cat %S/filecheck.input | %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC %s --match-full-lines
; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-EMPTY:
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: cat %S/filecheck.input | %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC %s --match-full-lines
; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-EMPTY:
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: cat %S/filecheck.input | %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC %s --match-full-lines
; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-EMPTY:
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: cat %S/filecheck.input | %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC %s --match-full-lines
; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-EMPTY:
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
; RUN: cat %S/filecheck.input | %FILECHECK_EXEC %S/filecheck.check | %FILECHECK_TESTER_EXEC %s --match-full-lines
; RUN: %cat "%S/filecheck.input" | %FILECHECK_EXEC "%S/filecheck.check" | %FILECHECK_TESTER_EXEC "%s" --match-full-lines
; CHECK: {{^.*}}FileCheck{{(\.py)?$}}
; CHECK-EMPTY:

0 comments on commit 142be2d

Please sign in to comment.