1 # REQUIRES: lit-max-individual-test-time
3 ###############################################################################
4 # Check tests can hit timeout when set
5 ###############################################################################
7 # Check that the per test timeout is enforced when running GTest tests.
9 # RUN: not %{lit} -v %{inputs}/googletest-timeout \
10 # RUN: --param gtest_filter=InfiniteLoopSubTest --timeout=1 > %t.cmd.out
11 # RUN: FileCheck --check-prefix=CHECK-INF < %t.cmd.out %s
13 # Check that the per test timeout is enforced when running GTest tests via
14 # the configuration file
16 # RUN: not %{lit} -v %{inputs}/googletest-timeout \
17 # RUN: --param gtest_filter=InfiniteLoopSubTest --param set_timeout=1 \
18 # RUN: > %t.cfgset.out
19 # RUN: FileCheck --check-prefix=CHECK-INF < %t.cfgset.out %s
21 # CHECK-INF: -- Testing:
22 # CHECK-INF: TIMEOUT: googletest-timeout :: [[PATH:[Dd]ummy[Ss]ub[Dd]ir/]][[FILE:OneTest.py]]/0/2
23 # CHECK-INF-NEXT: ******************** TEST 'googletest-timeout :: [[PATH]][[FILE]]/0/2' FAILED ********************
24 # CHECK-INF-NEXT: Script(shard):
26 # CHECK-INF-NEXT: GTEST_OUTPUT=json:{{[^[:space:]]*}} GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=2 GTEST_SHARD_INDEX=0 {{.*}}[[FILE]]
31 # CHECK-INF-NEXT: exit:
33 # CHECK-INF-NEXT: Reached timeout of 1 seconds
34 # CHECK-INF: Timed Out: 1
36 ###############################################################################
37 # Check tests can complete with a timeout set
39 # `QuickSubTest` should execute quickly so we shouldn't wait anywhere near the
40 # 3600 second timeout.
41 ###############################################################################
43 # RUN: %{lit} -v %{inputs}/googletest-timeout \
44 # RUN: --param gtest_filter=QuickSubTest --timeout=3600 > %t.cmd.out
45 # RUN: FileCheck --check-prefix=CHECK-QUICK < %t.cmd.out %s
47 # CHECK-QUICK: PASS: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/0/2 {{.*}}
48 # CHECK-QUICK: Passed: 1
50 # Test per test timeout via a config file and on the command line.
51 # The value set on the command line should override the config file.
52 # RUN: %{lit} -v %{inputs}/googletest-timeout --param gtest_filter=QuickSubTest \
53 # RUN: --param set_timeout=1 --timeout=3600 \
54 # RUN: > %t.cmdover.out 2> %t.cmdover.err
55 # RUN: FileCheck --check-prefix=CHECK-QUICK < %t.cmdover.out %s
56 # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
58 # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 3600 seconds