xref: /llvm-project/llvm/utils/lit/tests/googletest-timeout.py (revision 0787253cb6458c466ed71c7ddd0f0ac2e7e78c2a)
1# REQUIRES: python-psutil
2
3# PR33934
4# XFAIL: windows
5
6# Check that the per test timeout is enforced when running GTest tests.
7#
8# RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout --timeout=1 > %t.cmd.out
9# RUN: FileCheck < %t.cmd.out %s
10
11# Check that the per test timeout is enforced when running GTest tests via
12# the configuration file
13#
14# RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout \
15# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
16# RUN: FileCheck < %t.cfgset.out %s
17
18# CHECK: -- Testing:
19# CHECK: PASS: googletest-timeout :: DummySubDir/OneTest/FirstTest.subTestA
20# CHECK: TIMEOUT: googletest-timeout :: DummySubDir/OneTest/FirstTest.subTestB
21# CHECK: TIMEOUT: googletest-timeout :: DummySubDir/OneTest/FirstTest.subTestC
22# CHECK: Expected Passes    : 1
23# CHECK: Individual Timeouts: 2
24
25# Test per test timeout via a config file and on the command line.
26# The value set on the command line should override the config file.
27# RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout \
28# RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
29# RUN: FileCheck < %t.cmdover.out %s
30# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
31
32# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds
33