blob: 098f4b6b56d7baa549b4d5e6af910492b24ea497 [file] [log] [blame]
Dan Liew75742412015-12-27 14:03:49 +00001# REQUIRES: python-psutil
Dan Liew8ade9e72018-03-28 13:55:13 +00002
Brian Gesiak07872532017-07-26 15:10:50 +00003# PR33944
4# XFAIL: windows
5
Dan Liew75742412015-12-27 14:03:49 +00006# Test per test timeout using external shell
7# RUN: not %{lit} \
8# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +00009# RUN: %{inputs}/shtest-timeout/short.py \
10# RUN: %{inputs}/shtest-timeout/slow.py \
11# RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err
12# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s
13# RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s
14#
15# CHECK-EXTSH-ERR: Using external shell
16
17# Test per test timeout using internal shell
18# RUN: not %{lit} \
19# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000020# RUN: %{inputs}/shtest-timeout/short.py \
21# RUN: %{inputs}/shtest-timeout/slow.py \
22# RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err
23# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s
24# RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s
25# RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
Dan Liew75742412015-12-27 14:03:49 +000026
Michal Gorny1d62f4a2016-10-12 21:40:08 +000027# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
28# CHECK-INTSH-OUT: command output:
Michal Gorny1d62f4a2016-10-12 21:40:08 +000029# CHECK-INTSH-OUT: command reached timeout: True
Dan Liew75742412015-12-27 14:03:49 +000030
Dan Liew75742412015-12-27 14:03:49 +000031# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: slow.py
Michal Gorny1d62f4a2016-10-12 21:40:08 +000032# CHECK-INTSH-OUT: command output:
Michal Gorny1d62f4a2016-10-12 21:40:08 +000033# CHECK-INTSH-OUT: command reached timeout: True
Dan Liew75742412015-12-27 14:03:49 +000034
35# CHECK-INTSH-ERR: Using internal shell
36
37# Test per test timeout set via a config file rather than on the command line
38# RUN: not %{lit} \
39# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000040# RUN: %{inputs}/shtest-timeout/short.py \
41# RUN: %{inputs}/shtest-timeout/slow.py \
42# RUN: -j 1 -v --debug --param external=0 \
43# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
44# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s
45# RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s
46#
47# CHECK-CFGSET-ERR: Using internal shell
48
49# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py
50# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
51# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
Dan Liew75742412015-12-27 14:03:49 +000052
Dan Liew75742412015-12-27 14:03:49 +000053# CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py
54
55# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: slow.py
56# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
57# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
Dan Liew75742412015-12-27 14:03:49 +000058
59# CHECK-OUT-COMMON: Expected Passes{{ *}}: 1
Dan Liew7efde3c2018-03-28 13:55:08 +000060# CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 2
Dan Liew75742412015-12-27 14:03:49 +000061
62# Test per test timeout via a config file and on the command line.
63# The value set on the command line should override the config file.
64# RUN: not %{lit} \
65# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000066# RUN: %{inputs}/shtest-timeout/short.py \
67# RUN: %{inputs}/shtest-timeout/slow.py \
68# RUN: -j 1 -v --debug --param external=0 \
69# RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
70# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s
71# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
72
73# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds
74
75# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
76# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
77# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
Dan Liew75742412015-12-27 14:03:49 +000078
Dan Liew75742412015-12-27 14:03:49 +000079# CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py
80
81# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: slow.py
82# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
83# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
Dan Liew75742412015-12-27 14:03:49 +000084
85# CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1
Dan Liew7efde3c2018-03-28 13:55:08 +000086# CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 2