Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 1 | # REQUIRES: python-psutil |
Dan Liew | 8ade9e7 | 2018-03-28 13:55:13 +0000 | [diff] [blame] | 2 | |
Brian Gesiak | 0787253 | 2017-07-26 15:10:50 +0000 | [diff] [blame] | 3 | # PR33944 |
| 4 | # XFAIL: windows |
| 5 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 6 | # Test per test timeout using external shell |
| 7 | # RUN: not %{lit} \ |
| 8 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 9 | # RUN: %{inputs}/shtest-timeout/short.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 10 | # RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err |
| 11 | # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s |
| 12 | # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s |
| 13 | # |
| 14 | # CHECK-EXTSH-ERR: Using external shell |
| 15 | |
| 16 | # Test per test timeout using internal shell |
| 17 | # RUN: not %{lit} \ |
| 18 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 19 | # RUN: %{inputs}/shtest-timeout/short.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 20 | # RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err |
| 21 | # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s |
| 22 | # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s |
| 23 | # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 24 | |
Michal Gorny | 1d62f4a | 2016-10-12 21:40:08 +0000 | [diff] [blame] | 25 | # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py |
| 26 | # CHECK-INTSH-OUT: command output: |
Michal Gorny | 1d62f4a | 2016-10-12 21:40:08 +0000 | [diff] [blame] | 27 | # CHECK-INTSH-OUT: command reached timeout: True |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 28 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 29 | # CHECK-INTSH-ERR: Using internal shell |
| 30 | |
| 31 | # Test per test timeout set via a config file rather than on the command line |
| 32 | # RUN: not %{lit} \ |
| 33 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 34 | # RUN: %{inputs}/shtest-timeout/short.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 35 | # RUN: -j 1 -v --debug --param external=0 \ |
| 36 | # RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err |
| 37 | # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s |
| 38 | # RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s |
| 39 | # |
| 40 | # CHECK-CFGSET-ERR: Using internal shell |
| 41 | |
| 42 | # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py |
| 43 | # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds |
| 44 | # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 45 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 46 | # CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py |
| 47 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 48 | # CHECK-OUT-COMMON: Expected Passes{{ *}}: 1 |
Dan Liew | 9f77868 | 2018-05-22 15:06:24 +0000 | [diff] [blame^] | 49 | # CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 1 |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 50 | |
| 51 | # Test per test timeout via a config file and on the command line. |
| 52 | # The value set on the command line should override the config file. |
| 53 | # RUN: not %{lit} \ |
| 54 | # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 55 | # RUN: %{inputs}/shtest-timeout/short.py \ |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 56 | # RUN: -j 1 -v --debug --param external=0 \ |
| 57 | # RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err |
| 58 | # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s |
| 59 | # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s |
| 60 | |
| 61 | # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds |
| 62 | |
| 63 | # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py |
| 64 | # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds |
| 65 | # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 66 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 67 | # CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py |
| 68 | |
Dan Liew | 7574241 | 2015-12-27 14:03:49 +0000 | [diff] [blame] | 69 | # CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1 |
Dan Liew | 9f77868 | 2018-05-22 15:06:24 +0000 | [diff] [blame^] | 70 | # CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 1 |