/rv32x-llvm/utils/lit/tests/shtest-timeout.py

https://gitlab.com/williamwp/riscv-rv32x-llvm
Python | 75 lines | 0 code | 15 blank | 60 comment | 0 complexity | d2adbca1e2fa0bf217c15d18b96b244a MD5 | raw file
  1. # REQUIRES: python-psutil
  2. # llvm.org/PR33944
  3. # UNSUPPORTED: system-windows
  4. # FIXME: This test is fragile because it relies on time which can
  5. # be affected by system performance. In particular we are currently
  6. # assuming that `short.py` can be successfully executed within 2
  7. # seconds of wallclock time.
  8. # Test per test timeout using external shell
  9. # RUN: not %{lit} \
  10. # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
  11. # RUN: %{inputs}/shtest-timeout/short.py \
  12. # RUN: -j 1 -v --debug --timeout 2 --param external=1 > %t.extsh.out 2> %t.extsh.err
  13. # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s
  14. # RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s
  15. #
  16. # CHECK-EXTSH-ERR: Using external shell
  17. # Test per test timeout using internal shell
  18. # RUN: not %{lit} \
  19. # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
  20. # RUN: %{inputs}/shtest-timeout/short.py \
  21. # RUN: -j 1 -v --debug --timeout 2 --param external=0 > %t.intsh.out 2> %t.intsh.err
  22. # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s
  23. # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s
  24. # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s
  25. # CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
  26. # CHECK-INTSH-OUT: command output:
  27. # CHECK-INTSH-OUT: command reached timeout: True
  28. # CHECK-INTSH-ERR: Using internal shell
  29. # Test per test timeout set via a config file rather than on the command line
  30. # RUN: not %{lit} \
  31. # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
  32. # RUN: %{inputs}/shtest-timeout/short.py \
  33. # RUN: -j 1 -v --debug --param external=0 \
  34. # RUN: --param set_timeout=2 > %t.cfgset.out 2> %t.cfgset.err
  35. # RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s
  36. # RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s
  37. #
  38. # CHECK-CFGSET-ERR: Using internal shell
  39. # CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py
  40. # CHECK-OUT-COMMON: Timeout: Reached timeout of 2 seconds
  41. # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output
  42. # CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py
  43. # CHECK-OUT-COMMON: Expected Passes{{ *}}: 1
  44. # CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 1
  45. # Test per test timeout via a config file and on the command line.
  46. # The value set on the command line should override the config file.
  47. # RUN: not %{lit} \
  48. # RUN: %{inputs}/shtest-timeout/infinite_loop.py \
  49. # RUN: %{inputs}/shtest-timeout/short.py \
  50. # RUN: -j 1 -v --debug --param external=0 \
  51. # RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err
  52. # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s
  53. # RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s
  54. # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds
  55. # CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py
  56. # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds
  57. # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output
  58. # CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py
  59. # CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1
  60. # CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 1