Home | History | Annotate | Download | only in shtest-timeout
      1 # RUN: %{python} %s quick
      2 # RUN: %{python} %s slow
      3 from __future__ import print_function
      4 
      5 import time
      6 import sys
      7 
      8 if len(sys.argv) != 2:
      9     print("Wrong number of args")
     10     sys.exit(1)
     11 
     12 mode =  sys.argv[1]
     13 
     14 if mode == 'slow':
     15     print("Running in slow mode")
     16     sys.stdout.flush() # Make sure the print gets flushed so it appears in lit output.
     17     time.sleep(6)
     18     sys.exit(0)
     19 elif mode == 'quick':
     20     print("Running in quick mode")
     21     sys.exit(0)
     22 else:
     23     print("Unrecognised mode {}".format(mode))
     24     sys.exit(1)
     25