File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change
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 )
Original file line number Diff line number Diff line change 3
3
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -disable-playground-transform -o %t/main %t/main.swift
4
4
// RUN: %target-codesign %t/main
5
5
// 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
7
7
// REQUIRES: executable_test
8
8
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
10
10
// status doesn't reflect whether its child process crashed or not. So "not
11
11
// --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 .
14
14
15
15
func f( crash crash: Bool ) -> Int {
16
16
if crash {
17
17
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]]
19
19
} else {
20
20
return 42
21
21
}
You can’t perform that action at this time.
0 commit comments