summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-02-16 00:44:00 +0000
committerJulian Lettner <jlettner@apple.com>2019-02-16 00:44:00 +0000
commit70ca752ccf6a8f362aea25ccd3ee2bbceca93b20 (patch)
treeaa7415948397e4e8b4c57ad73920b4844b2dead1
parent0d15bb5d33836ea776d5fa05790bc1ce397a97cf (diff)
downloadbcm5719-llvm-70ca752ccf6a8f362aea25ccd3ee2bbceca93b20.tar.gz
bcm5719-llvm-70ca752ccf6a8f362aea25ccd3ee2bbceca93b20.zip
[lit] Remove LitTestCase
From the docs: `class LitTestCase(unittest.TestCase)` LitTestCase is an adaptor for providing a 'unittest' compatible interface to 'lit' tests so that we can run lit tests with standard python test runners. It does not seem to be used anywhere. Differential Revision: https://reviews.llvm.org/D58264 llvm-svn: 354188
-rw-r--r--llvm/utils/lit/lit/LitTestCase.py34
-rw-r--r--llvm/utils/lit/lit/discovery.py24
-rw-r--r--llvm/utils/lit/lit/run.py3
-rw-r--r--llvm/utils/lit/tests/Inputs/unittest-adaptor/lit.cfg6
-rw-r--r--llvm/utils/lit/tests/Inputs/unittest-adaptor/test-one.txt1
-rw-r--r--llvm/utils/lit/tests/Inputs/unittest-adaptor/test-two.txt1
-rw-r--r--llvm/utils/lit/tests/unittest-adaptor.py18
7 files changed, 0 insertions, 87 deletions
diff --git a/llvm/utils/lit/lit/LitTestCase.py b/llvm/utils/lit/lit/LitTestCase.py
deleted file mode 100644
index e04846c7bd6..00000000000
--- a/llvm/utils/lit/lit/LitTestCase.py
+++ /dev/null
@@ -1,34 +0,0 @@
-from __future__ import absolute_import
-import unittest
-
-import lit.Test
-
-"""
-TestCase adaptor for providing a 'unittest' compatible interface to 'lit' tests.
-"""
-
-class UnresolvedError(RuntimeError):
- pass
-
-class LitTestCase(unittest.TestCase):
- def __init__(self, test, run):
- unittest.TestCase.__init__(self)
- self._test = test
- self._run = run
-
- def id(self):
- return self._test.getFullName()
-
- def shortDescription(self):
- return self._test.getFullName()
-
- def runTest(self):
- # Run the test.
- self._run.execute_test(self._test)
-
- # Adapt the result to unittest.
- result = self._test.result
- if result.code is lit.Test.UNRESOLVED:
- raise UnresolvedError(result.output)
- elif result.code.isFailure:
- self.fail(result.output)
diff --git a/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py
index c4d30319c47..6867f5ca77f 100644
--- a/llvm/utils/lit/lit/discovery.py
+++ b/llvm/utils/lit/lit/discovery.py
@@ -249,27 +249,3 @@ def find_tests_for_inputs(lit_config, inputs):
sys.exit(2)
return tests
-
-def load_test_suite(inputs):
- import platform
- import unittest
- from lit.LitTestCase import LitTestCase
-
- # Create the global config object.
- litConfig = LitConfig.LitConfig(progname = 'lit',
- path = [],
- quiet = False,
- useValgrind = False,
- valgrindLeakCheck = False,
- valgrindArgs = [],
- noExecute = False,
- debug = False,
- isWindows = (platform.system()=='Windows'),
- params = {})
-
- # Perform test discovery.
- run = lit.run.Run(litConfig, find_tests_for_inputs(litConfig, inputs))
-
- # Return a unittest test suite which just runs the tests in order.
- return unittest.TestSuite([LitTestCase(test, run)
- for test in run.tests])
diff --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py
index 5483f7ffecb..a33e541654b 100644
--- a/llvm/utils/lit/lit/run.py
+++ b/llvm/utils/lit/lit/run.py
@@ -32,9 +32,6 @@ class Run(object):
{k: multiprocessing.BoundedSemaphore(v) for k, v in
self.lit_config.parallelism_groups.items()}
- def execute_test(self, test):
- return lit.worker._execute_test(test, self.lit_config)
-
def execute_tests_in_pool(self, jobs, max_time):
# We need to issue many wait calls, so compute the final deadline and
# subtract time.time() from that as we go along.
diff --git a/llvm/utils/lit/tests/Inputs/unittest-adaptor/lit.cfg b/llvm/utils/lit/tests/Inputs/unittest-adaptor/lit.cfg
deleted file mode 100644
index 9e08a8629a4..00000000000
--- a/llvm/utils/lit/tests/Inputs/unittest-adaptor/lit.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-import lit.formats
-config.name = 'unittest-adaptor'
-config.suffixes = ['.txt']
-config.test_format = lit.formats.ShTest()
-config.test_source_root = None
-config.test_exec_root = None
diff --git a/llvm/utils/lit/tests/Inputs/unittest-adaptor/test-one.txt b/llvm/utils/lit/tests/Inputs/unittest-adaptor/test-one.txt
deleted file mode 100644
index b80b60b7a27..00000000000
--- a/llvm/utils/lit/tests/Inputs/unittest-adaptor/test-one.txt
+++ /dev/null
@@ -1 +0,0 @@
-# RUN: true
diff --git a/llvm/utils/lit/tests/Inputs/unittest-adaptor/test-two.txt b/llvm/utils/lit/tests/Inputs/unittest-adaptor/test-two.txt
deleted file mode 100644
index 49932c3006e..00000000000
--- a/llvm/utils/lit/tests/Inputs/unittest-adaptor/test-two.txt
+++ /dev/null
@@ -1 +0,0 @@
-# RUN: false
diff --git a/llvm/utils/lit/tests/unittest-adaptor.py b/llvm/utils/lit/tests/unittest-adaptor.py
deleted file mode 100644
index 0848cd22baa..00000000000
--- a/llvm/utils/lit/tests/unittest-adaptor.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Check the lit adaption to run under unittest.
-#
-# RUN: %{python} %s %{inputs}/unittest-adaptor 2> %t.err
-# RUN: FileCheck < %t.err %s
-#
-# CHECK-DAG: unittest-adaptor :: test-two.txt ... FAIL
-# CHECK-DAG: unittest-adaptor :: test-one.txt ... ok
-
-import unittest
-import sys
-
-import lit
-import lit.discovery
-
-input_path = sys.argv[1]
-unittest_suite = lit.discovery.load_test_suite([input_path])
-runner = unittest.TextTestRunner(verbosity=2)
-runner.run(unittest_suite)
OpenPOWER on IntegriCloud