1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

[lit] Fix tests on Windows

max-time.py:
  Windows does not have a native `sleep` command, use `time.sleep()` in
  Python instead.

max-failures.py:
  The max-failure test reused the shtest-shell test inputs instead of
  defining its own "test domain".  However, the output of this
  shtest-shell "test domain" is slightly different on Windows, which now
  bites us since we made the max-failures test stricter.  Let's define
  our own "max failures" test domain.
This commit is contained in:
Julian Lettner 2020-04-10 17:12:54 -07:00
parent f04e26215b
commit db6e460f3e
8 changed files with 24 additions and 11 deletions

View File

@ -0,0 +1 @@
RUN: false

View File

@ -0,0 +1 @@
RUN: false

View File

@ -0,0 +1 @@
RUN: false

View File

@ -1,2 +1,6 @@
lit_config.load_config(config, os.path.dirname(__file__) + "/../shtest-shell/lit.cfg")
config.test_source_root = os.path.dirname(__file__) + '/../shtest-shell'
import lit.formats
config.name = 'max-failures'
config.suffixes = ['.txt']
config.test_format = lit.formats.ShTest()
config.test_source_root = None
config.test_exec_root = None

View File

@ -1,6 +1,7 @@
import lit.formats
config.name = 'lit-time'
config.suffixes = ['.txt']
config.name = 'max-time'
config.suffixes = ['.txt', '.py']
config.test_format = lit.formats.ShTest()
config.test_source_root = None
config.test_exec_root = None
config.substitutions.append(('%{python}', '"%s"' % (sys.executable)))

View File

@ -0,0 +1,7 @@
# 'sleep 60' in Python because Windows does not have a native sleep command.
#
# RUN: %{python} %s
import time
time.sleep(60)

View File

@ -1 +0,0 @@
RUN: sleep 60

View File

@ -6,18 +6,17 @@
# RUN: not %{lit} --max-failures=0 -j 1 %{inputs}/max-failures 2>> %t.out
# RUN: FileCheck < %t.out %s
#
# END.
# CHECK-NOT: reached maximum number of test failures
# CHECK-NOT: Skipped Tests
# CHECK: Unexpected Failures: 35
# CHECK: Unexpected Failures: 3
# CHECK: reached maximum number of test failures, skipping remaining tests
# CHECK: Skipped Tests : 41
# CHECK: Unexpected Failures: 1
# CHECK: Skipped Tests : 2
# CHECK: Unexpected Failures: 1
# CHECK: reached maximum number of test failures, skipping remaining tests
# CHECK: Skipped Tests : 40
# CHECK: Unexpected Failures: 2
# CHECK: Skipped Tests : 1
# CHECK: Unexpected Failures: 2
# CHECK: error: argument --max-failures: requires positive integer, but found '0'