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 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
1515func 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 }
You can’t perform that action at this time.
0 commit comments