1 # REQUIRES: lit-max-individual-test-time
4 # UNSUPPORTED: system-windows
6 ###############################################################################
7 # Check tests can hit timeout when set
8 ###############################################################################
10 # Test per test timeout using external shell
12 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
13 # RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err
14 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s
15 # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s
17 # CHECK-EXTSH-ERR: Using external shell
19 # Test per test timeout using internal shell
21 # RUN: %{inputs}/shtest-timeout/infinite_loop.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
27 # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
28 # CHECK-INTSH-OUT: command reached timeout: True
30 # CHECK-INTSH-ERR: Using internal shell
32 # Test per test timeout set via a config file rather than on the command line
34 # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
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
40 # CHECK-CFGSET-ERR: Using internal shell
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: Timed Out: 1
47 ###############################################################################
48 # Check tests can complete in with a timeout set
50 # `short.py` should execute quickly so we shouldn't wait anywhere near the
51 # 3600 second timeout.
52 ###############################################################################
54 # Test per test timeout using external shell
56 # RUN: %{inputs}/shtest-timeout/short.py \
57 # RUN: -j 1 -v --debug --timeout 3600 --param external=1 > %t.pass.extsh.out 2> %t.pass.extsh.err
58 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON-SHORT < %t.pass.extsh.out %s
59 # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.pass.extsh.err %s
61 # Test per test timeout using internal shell
63 # RUN: %{inputs}/shtest-timeout/short.py \
64 # RUN: -j 1 -v --debug --timeout 3600 --param external=0 > %t.pass.intsh.out 2> %t.pass.intsh.err
65 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON-SHORT < %t.pass.intsh.out %s
66 # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.pass.intsh.err %s
68 # CHECK-OUT-COMMON-SHORT: PASS: per_test_timeout :: short.py
69 # CHECK-OUT-COMMON-SHORT: Passed: 1
71 # Test per test timeout via a config file and on the command line.
72 # The value set on the command line should override the config file.
74 # RUN: %{inputs}/shtest-timeout/short.py \
75 # RUN: -j 1 -v --debug --param external=0 \
76 # RUN: --param set_timeout=1 --timeout=3600 > %t.pass.cmdover.out 2> %t.pass.cmdover.err
77 # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON-SHORT < %t.pass.cmdover.out %s
78 # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.pass.cmdover.err %s
80 # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 3600 seconds