blob: 12371c688e6c2a9244675aba616f40752a6ce1bd [file] [log] [blame]
Dan Liew75742412015-12-27 14:03:49 +00001# REQUIRES: python-psutil
Jan Korous1e0e0b02018-03-27 00:16:28 +00002#
3# rdar://problem/38774530
4# UNSUPPORTED: darwin
5#
Brian Gesiak07872532017-07-26 15:10:50 +00006# PR33944
7# XFAIL: windows
8
Dan Liew75742412015-12-27 14:03:49 +00009# Test per test timeout using external shell
10# RUN: not %{lit} \
11# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000012# RUN: %{inputs}/shtest-timeout/short.py \
13# RUN: %{inputs}/shtest-timeout/slow.py \
14# RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err
15# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s
16# RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s
17#
18# CHECK-EXTSH-ERR: Using external shell
19
20# Test per test timeout using internal shell
21# RUN: not %{lit} \
22# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000023# RUN: %{inputs}/shtest-timeout/short.py \
24# RUN: %{inputs}/shtest-timeout/slow.py \
25# RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err
26# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s
27# RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s
28# RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
Dan Liew75742412015-12-27 14:03:49 +000029
Michal Gorny1d62f4a2016-10-12 21:40:08 +000030# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
31# CHECK-INTSH-OUT: command output:
32# CHECK-INTSH-OUT-NEXT: Running infinite loop
33# CHECK-INTSH-OUT: command reached timeout: True
Dan Liew75742412015-12-27 14:03:49 +000034
Dan Liew75742412015-12-27 14:03:49 +000035# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: slow.py
Michal Gorny1d62f4a2016-10-12 21:40:08 +000036# CHECK-INTSH-OUT: command output:
Dan Liew75742412015-12-27 14:03:49 +000037# CHECK-INTSH-OUT-NEXT: Running slow program
Michal Gorny1d62f4a2016-10-12 21:40:08 +000038# CHECK-INTSH-OUT: command reached timeout: True
Dan Liew75742412015-12-27 14:03:49 +000039
40# CHECK-INTSH-ERR: Using internal shell
41
42# Test per test timeout set via a config file rather than on the command line
43# RUN: not %{lit} \
44# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000045# RUN: %{inputs}/shtest-timeout/short.py \
46# RUN: %{inputs}/shtest-timeout/slow.py \
47# RUN: -j 1 -v --debug --param external=0 \
48# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
49# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s
50# RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s
51#
52# CHECK-CFGSET-ERR: Using internal shell
53
54# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py
55# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
56# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
57# CHECK-OUT-COMMON: Running infinite loop
58
Dan Liew75742412015-12-27 14:03:49 +000059# CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py
60
61# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: slow.py
62# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds
63# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
64# CHECK-OUT-COMMON: Running slow program
65
66# CHECK-OUT-COMMON: Expected Passes{{ *}}: 1
Dan Liew7efde3c2018-03-28 13:55:08 +000067# CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 2
Dan Liew75742412015-12-27 14:03:49 +000068
69# Test per test timeout via a config file and on the command line.
70# The value set on the command line should override the config file.
71# RUN: not %{lit} \
72# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
Dan Liew75742412015-12-27 14:03:49 +000073# RUN: %{inputs}/shtest-timeout/short.py \
74# RUN: %{inputs}/shtest-timeout/slow.py \
75# RUN: -j 1 -v --debug --param external=0 \
76# RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
77# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s
78# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
79
80# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds
81
82# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
83# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
84# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
85# CHECK-CMDLINE-OVERRIDE-OUT: Running infinite loop
86
Dan Liew75742412015-12-27 14:03:49 +000087# CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py
88
89# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: slow.py
90# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
91# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
92# CHECK-CMDLINE-OVERRIDE-OUT: Running slow program
93
94# CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1
Dan Liew7efde3c2018-03-28 13:55:08 +000095# CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 2