blob: 81fe798349cbcc1a1127403e116b009c8bc44fd4 [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 \
Dan Liew75742412015-12-27 14:03:49 +000010# 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 Liew75742412015-12-27 14:03:49 +000019# RUN: %{inputs}/shtest-timeout/short.py \
Dan Liew75742412015-12-27 14:03:49 +000020# 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 Liew75742412015-12-27 14:03:49 +000024
Michal Gorny1d62f4a2016-10-12 21:40:08 +000025# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
26# CHECK-INTSH-OUT: command output:
Michal Gorny1d62f4a2016-10-12 21:40:08 +000027# CHECK-INTSH-OUT: command reached timeout: True
Dan Liew75742412015-12-27 14:03:49 +000028
Dan Liew75742412015-12-27 14:03:49 +000029# 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 Liew75742412015-12-27 14:03:49 +000034# RUN: %{inputs}/shtest-timeout/short.py \
Dan Liew75742412015-12-27 14:03:49 +000035# 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 Liew75742412015-12-27 14:03:49 +000045
Dan Liew75742412015-12-27 14:03:49 +000046# CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py
47
Dan Liew75742412015-12-27 14:03:49 +000048# CHECK-OUT-COMMON: Expected Passes{{ *}}: 1
Dan Liew9f778682018-05-22 15:06:24 +000049# CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 1
Dan Liew75742412015-12-27 14:03:49 +000050
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 Liew75742412015-12-27 14:03:49 +000055# RUN: %{inputs}/shtest-timeout/short.py \
Dan Liew75742412015-12-27 14:03:49 +000056# 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 Liew75742412015-12-27 14:03:49 +000066
Dan Liew75742412015-12-27 14:03:49 +000067# CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py
68
Dan Liew75742412015-12-27 14:03:49 +000069# CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1
Dan Liew9f778682018-05-22 15:06:24 +000070# CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 1