1# REQUIRES: python-psutil 2 3# Test per test timeout using external shell 4# RUN: not %{lit} \ 5# RUN: %{inputs}/shtest-timeout/infinite_loop.py \ 6# RUN: %{inputs}/shtest-timeout/quick_then_slow.py \ 7# RUN: %{inputs}/shtest-timeout/short.py \ 8# RUN: %{inputs}/shtest-timeout/slow.py \ 9# RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err 10# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s 11# RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s 12# 13# CHECK-EXTSH-ERR: Using external shell 14 15# Test per test timeout using internal shell 16# RUN: not %{lit} \ 17# RUN: %{inputs}/shtest-timeout/infinite_loop.py \ 18# RUN: %{inputs}/shtest-timeout/quick_then_slow.py \ 19# RUN: %{inputs}/shtest-timeout/short.py \ 20# RUN: %{inputs}/shtest-timeout/slow.py \ 21# RUN: -j 1 -v --debug --timeout 1 --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 26# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py 27# CHECK-INTSH-OUT: command output: 28# CHECK-INTSH-OUT-NEXT: Running infinite loop 29# CHECK-INTSH-OUT: command reached timeout: True 30 31# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: quick_then_slow.py 32# CHECK-INTSH-OUT: Timeout: Reached timeout of 1 seconds 33# CHECK-INTSH-OUT: Command Output 34# CHECK-INTSH-OUT: command output: 35# CHECK-INTSH-OUT-NEXT: Running in quick mode 36# CHECK-INTSH-OUT: command reached timeout: False 37# CHECK-INTSH-OUT: command output: 38# CHECK-INTSH-OUT-NEXT: Running in slow mode 39# CHECK-INTSH-OUT: command reached timeout: True 40 41# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: slow.py 42# CHECK-INTSH-OUT: command output: 43# CHECK-INTSH-OUT-NEXT: Running slow program 44# CHECK-INTSH-OUT: command reached timeout: True 45 46# CHECK-INTSH-ERR: Using internal shell 47 48# Test per test timeout set via a config file rather than on the command line 49# RUN: not %{lit} \ 50# RUN: %{inputs}/shtest-timeout/infinite_loop.py \ 51# RUN: %{inputs}/shtest-timeout/quick_then_slow.py \ 52# RUN: %{inputs}/shtest-timeout/short.py \ 53# RUN: %{inputs}/shtest-timeout/slow.py \ 54# RUN: -j 1 -v --debug --param external=0 \ 55# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err 56# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s 57# RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s 58# 59# CHECK-CFGSET-ERR: Using internal shell 60 61# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py 62# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds 63# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output 64# CHECK-OUT-COMMON: Running infinite loop 65 66# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: quick_then_slow.py 67# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds 68# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output 69# CHECK-OUT-COMMON: Running in quick mode 70# CHECK-OUT-COMMON: Running in slow mode 71 72# CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py 73 74# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: slow.py 75# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds 76# CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output 77# CHECK-OUT-COMMON: Running slow program 78 79# CHECK-OUT-COMMON: Expected Passes{{ *}}: 1 80# CHECK-OUT-COMMON: Individual Timeouts{{ *}}: 3 81 82# Test per test timeout via a config file and on the command line. 83# The value set on the command line should override the config file. 84# RUN: not %{lit} \ 85# RUN: %{inputs}/shtest-timeout/infinite_loop.py \ 86# RUN: %{inputs}/shtest-timeout/quick_then_slow.py \ 87# RUN: %{inputs}/shtest-timeout/short.py \ 88# RUN: %{inputs}/shtest-timeout/slow.py \ 89# RUN: -j 1 -v --debug --param external=0 \ 90# RUN: --param set_timeout=1 --timeout=2 > %t.cmdover.out 2> %t.cmdover.err 91# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-OUT < %t.cmdover.out %s 92# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.cmdover.err %s 93 94# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds 95 96# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py 97# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds 98# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output 99# CHECK-CMDLINE-OVERRIDE-OUT: Running infinite loop 100 101# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: quick_then_slow.py 102# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds 103# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output 104# CHECK-CMDLINE-OVERRIDE-OUT: Running in quick mode 105# CHECK-CMDLINE-OVERRIDE-OUT: Running in slow mode 106 107# CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py 108 109# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: slow.py 110# CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds 111# CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output 112# CHECK-CMDLINE-OVERRIDE-OUT: Running slow program 113 114# CHECK-CMDLINE-OVERRIDE-OUT: Expected Passes{{ *}}: 1 115# CHECK-CMDLINE-OVERRIDE-OUT: Individual Timeouts{{ *}}: 3 116