Skip to content

Commit a33203f

Browse files
authored
Merge pull request #4187 from apple/FileCheck-substitution
Tests: make FileCheck a substitution that sanitizes the input
2 parents 87e3d02 + 94c7c3a commit a33203f

File tree

1,691 files changed

+4870
-4794
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,691 files changed

+4870
-4794
lines changed

docs/Testing.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,16 @@ Other substitutions:
358358
* ``%{python}``: run the same Python interpreter that's being used to run the
359359
current ``lit`` test.
360360

361+
* ``%FileCheck``: like the LLVM ``FileCheck`` utility, but occurrences of full
362+
paths to the source and build directories in the input text are replaced with
363+
path-independent constants.
364+
365+
* ``%raw-FileCheck``: the LLVM ``FileCheck`` utility.
366+
361367
When writing a test where output (or IR, SIL) depends on the bitness of the
362368
target CPU, use this pattern::
363369

364-
// RUN: %target-swift-frontend ... | FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize %s
370+
// RUN: %target-swift-frontend ... | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize %s
365371

366372
// CHECK: common line
367373
// CHECK-32: only for 32-bit
@@ -377,7 +383,7 @@ target CPU, use this pattern::
377383
When writing a test where output (or IR, SIL) depends on the target CPU itself,
378384
use this pattern::
379385

380-
// RUN: %target-swift-frontend ... | FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-cpu %s
386+
// RUN: %target-swift-frontend ... | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-cpu %s
381387

382388
// CHECK: common line
383389
// CHECK-i386: only for i386

test/1_stdlib/BridgeNonVerbatim.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// outlive the array.
1717
//
1818
//===----------------------------------------------------------------------===//
19-
// RUN: %target-run-stdlib-swift %s | FileCheck %s
19+
// RUN: %target-run-stdlib-swift %s | %FileCheck %s
2020
// REQUIRES: executable_test
2121
//
2222
// REQUIRES: objc_interop

test/1_stdlib/Bridgeable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift | FileCheck %s
1+
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

44
// REQUIRES: objc_interop

test/1_stdlib/FloatingPointIR.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %target-build-swift -emit-ir %s | FileCheck -check-prefix=%target-cpu %s
2-
// RUN: %target-build-swift -O -emit-ir %s | FileCheck -check-prefix=%target-cpu %s
3-
// RUN: %target-build-swift -Ounchecked -emit-ir %s | FileCheck -check-prefix=%target-cpu %s
1+
// RUN: %target-build-swift -emit-ir %s | %FileCheck -check-prefix=%target-cpu %s
2+
// RUN: %target-build-swift -O -emit-ir %s | %FileCheck -check-prefix=%target-cpu %s
3+
// RUN: %target-build-swift -Ounchecked -emit-ir %s | %FileCheck -check-prefix=%target-cpu %s
44

55
var globalFloat32 : Float32 = 0.0
66
var globalFloat64 : Float64 = 0.0

test/1_stdlib/HeapBuffer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift | FileCheck %s
1+
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

44
import Swift

test/1_stdlib/ImplicitlyUnwrappedOptional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift | FileCheck %s
1+
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

44
var x : Int! = .none

test/1_stdlib/KVO.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift | FileCheck %s
1+
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

44
// REQUIRES: objc_interop

test/1_stdlib/Leak.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift | FileCheck %s
1+
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: leak-checker
33

44
import StdlibUnittest

test/1_stdlib/Map.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
// RUN: %target-run-simple-swift | FileCheck %s
12+
// RUN: %target-run-simple-swift | %FileCheck %s
1313
// REQUIRES: executable_test
1414

1515
// Check that the generic parameters are called 'Base' and 'Element'.

test/1_stdlib/NSError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// REQUIRES: objc_interop
55

66
// RUN: %target-build-swift %s 2> %t.warnings.txt
7-
// RUN: FileCheck -check-prefix=CHECK-WARNINGS %s < %t.warnings.txt
7+
// RUN: %FileCheck -check-prefix=CHECK-WARNINGS %s < %t.warnings.txt
88

99
import StdlibUnittest
1010

0 commit comments

Comments
 (0)