googletest-timeout.py 1.3 KB

1234567891011121314151617181920212223242526272829
  1. # REQUIRES: lit-max-individual-test-time
  2. # Check that the per test timeout is enforced when running GTest tests.
  3. #
  4. # RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout --timeout=1 > %t.cmd.out
  5. # RUN: FileCheck < %t.cmd.out %s
  6. # Check that the per test timeout is enforced when running GTest tests via
  7. # the configuration file
  8. #
  9. # RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout \
  10. # RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err
  11. # RUN: FileCheck < %t.cfgset.out %s
  12. # CHECK: -- Testing:
  13. # CHECK: PASS: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestA
  14. # CHECK: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB
  15. # CHECK: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestC
  16. # CHECK: Expected Passes : 1
  17. # CHECK: Individual Timeouts: 2
  18. # Test per test timeout via a config file and on the command line.
  19. # The value set on the command line should override the config file.
  20. # RUN: not %{lit} -j 1 -v %{inputs}/googletest-timeout \
  21. # RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
  22. # RUN: FileCheck < %t.cmdover.out %s
  23. # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
  24. # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds