File tree Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift -parse-stdlib %s -module-name Reflection -o %t/a.out
3
3
// RUN: %target-codesign %t/a.out
4
- // RUN: %S/timeout.sh 360 %target-run %t/a.out | %FileCheck %s
4
+ // RUN: %{python} % S/timeout.py 360 %target-run %t/a.out | %FileCheck %s
5
5
// REQUIRES: executable_test
6
6
// FIXME: timeout wrapper is necessary because the ASan test runs for hours
7
7
Original file line number Diff line number Diff line change 3
3
// RUN: %target-clang %S/Inputs/Mirror/Mirror.mm -c -o %t/Mirror.mm.o -g
4
4
// RUN: %target-build-swift -parse-stdlib %s -module-name Reflection -I %S/Inputs/Mirror/ -Xlinker %t/Mirror.mm.o -o %t/a.out
5
5
// RUN: %target-codesign %t/a.out
6
- // RUN: %S/timeout.sh 360 %target-run %t/a.out %S/Inputs/shuffle.jpg | %FileCheck %s
7
- // REQUIRES: executable_test
6
+ // RUN: %{python} %S/timeout.py 360 %target-run %t/a.out %S/Inputs/shuffle.jpg | %FileCheck %s
8
7
// FIXME: timeout wrapper is necessary because the ASan test runs for hours
9
8
9
+ // REQUIRES: executable_test
10
+ // REQUIRES: objc_interop
11
+
10
12
//
11
13
// DO NOT add more tests to this file. Add them to test/1_stdlib/Runtime.swift.
12
14
//
13
15
14
- // XFAIL: linux
15
16
16
17
import Swift
17
18
import Foundation
Original file line number Diff line number Diff line change
1
+ #!/uar/bin/env python
2
+
3
+ import subprocess
4
+ import sys
5
+ import threading
6
+
7
+
8
+ def watchdog (command , timeout = None ):
9
+ process = subprocess .Popen (command )
10
+ timer = threading .Timer (timeout , process .kill )
11
+ try :
12
+ timer .start ()
13
+ process .communicate ()
14
+ finally :
15
+ timer .cancel ()
16
+
17
+
18
+ if __name__ == '__main__' :
19
+ watchdog (sys .argv [2 :], timeout = sys .argv [1 ])
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments