81 lines · python
1# REQUIRES: lit-max-individual-test-time2 3# llvm.org/PR339444# UNSUPPORTED: system-windows5 6###############################################################################7# Check tests can hit timeout when set8###############################################################################9 10# Test per test timeout using external shell11# RUN: not %{lit} \12# RUN: %{inputs}/shtest-timeout/infinite_loop.py \13# RUN: -j 1 -v --debug --timeout 1 --param external=1 > %t.extsh.out 2> %t.extsh.err14# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.extsh.out %s15# RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.extsh.err %s16#17# CHECK-EXTSH-ERR: Using external shell18 19# Test per test timeout using internal shell20# RUN: not %{lit} \21# RUN: %{inputs}/shtest-timeout/infinite_loop.py \22# RUN: -j 1 -v --debug --timeout 1 --param external=0 > %t.intsh.out 2> %t.intsh.err23# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.intsh.out %s24# RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s25# RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s26 27# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py28# CHECK-INTSH-OUT: command reached timeout: True29 30# CHECK-INTSH-ERR: Using internal shell31 32# Test per test timeout set via a config file rather than on the command line33# RUN: not %{lit} \34# RUN: %{inputs}/shtest-timeout/infinite_loop.py \35# RUN: -j 1 -v --debug --param external=0 \36# RUN: --param set_timeout=1 > %t.cfgset.out 2> %t.cfgset.err37# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON < %t.cfgset.out %s38# RUN: FileCheck --check-prefix=CHECK-CFGSET-ERR < %t.cfgset.err %s39#40# CHECK-CFGSET-ERR: Using internal shell41 42# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py43# CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds44# CHECK-OUT-COMMON: Timed Out: 145 46 47###############################################################################48# Check tests can complete in with a timeout set49#50# `short.py` should execute quickly so we shouldn't wait anywhere near the51# 3600 second timeout.52###############################################################################53 54# Test per test timeout using external shell55# RUN: %{lit} \56# RUN: %{inputs}/shtest-timeout/short.py \57# RUN: -j 1 -v --debug --timeout 3600 --param external=1 > %t.pass.extsh.out 2> %t.pass.extsh.err58# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON-SHORT < %t.pass.extsh.out %s59# RUN: FileCheck --check-prefix=CHECK-EXTSH-ERR < %t.pass.extsh.err %s60 61# Test per test timeout using internal shell62# RUN: %{lit} \63# RUN: %{inputs}/shtest-timeout/short.py \64# RUN: -j 1 -v --debug --timeout 3600 --param external=0 > %t.pass.intsh.out 2> %t.pass.intsh.err65# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON-SHORT < %t.pass.intsh.out %s66# RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.pass.intsh.err %s67 68# CHECK-OUT-COMMON-SHORT: PASS: per_test_timeout :: short.py69# CHECK-OUT-COMMON-SHORT: Passed: 170 71# Test per test timeout via a config file and on the command line.72# The value set on the command line should override the config file.73# RUN: %{lit} \74# RUN: %{inputs}/shtest-timeout/short.py \75# RUN: -j 1 -v --debug --param external=0 \76# RUN: --param set_timeout=1 --timeout=3600 > %t.pass.cmdover.out 2> %t.pass.cmdover.err77# RUN: FileCheck --check-prefix=CHECK-OUT-COMMON-SHORT < %t.pass.cmdover.out %s78# RUN: FileCheck --check-prefix=CHECK-CMDLINE-OVERRIDE-ERR < %t.pass.cmdover.err %s79 80# CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 3600 seconds81