Skip to content

Commit 9b4bfd8

Browse files
authored
Merge pull request swiftlang#23578 from plotfi/master
2 parents a62c87f + d1a7b99 commit 9b4bfd8

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import shlex
2+
import subprocess
3+
import sys
4+
5+
if len(sys.argv) < 2:
6+
print("Too few args to " + sys.argv[0])
7+
sys.exit(0)
8+
9+
try:
10+
subprocess.check_call(shlex.split(' '.join(sys.argv[1:])))
11+
sys.exit(1)
12+
except subprocess.CalledProcessError as e:
13+
sys.exit(0)

test/PlaygroundTransform/placeholder.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -disable-playground-transform -o %t/main %t/main.swift
44
// RUN: %target-codesign %t/main
55
// RUN: %target-run %t/main | %FileCheck %s
6-
// RUN: ! %target-run %t/main --crash 2>&1 | %FileCheck -check-prefix=CRASH-CHECK %s
6+
// RUN: %{python} %S/Inputs/not.py "%target-run %t/main --crash" 2>&1 | %FileCheck -check-prefix=CRASH-CHECK %s
77
// REQUIRES: executable_test
88

9-
// NOTE: "!" is used above instead of "not --crash" because simctl's exit
9+
// NOTE: not.py is used above instead of "not --crash" because simctl's exit
1010
// status doesn't reflect whether its child process crashed or not. So "not
1111
// --crash %target-run ..." always fails when testing for the iOS Simulator.
12-
// The more precise solution would be to use a version of 'not' cross-compiled
13-
// for the simulator.
12+
// not.py also works on win32, where ! does not.
13+
// Checking for ".[Ff]atal" because of d03a575279c.
1414

1515
func f(crash crash: Bool) -> Int {
1616
if crash {
1717
return <#T#>
18-
// CRASH-CHECK: fatal error: attempt to evaluate editor placeholder: file {{.*}}/main.swift, line [[@LINE-1]]
18+
// CRASH-CHECK: {{[fF]}}atal error: attempt to evaluate editor placeholder: file {{.*}}/main.swift, line [[@LINE-1]]
1919
} else {
2020
return 42
2121
}

0 commit comments

Comments
 (0)