summaryrefslogtreecommitdiff
path: root/utils/lit/examples
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-08-09 21:39:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-08-09 21:39:28 +0000
commitde404a2809c8cd5a017ddd7084aa28e2f36fac2d (patch)
treef277ffa762e84c1580618c5889ceffe720328f4d /utils/lit/examples
parenta5e463ea5fa7f671cf029b420bc2f375b8e71fba (diff)
downloadllvm-de404a2809c8cd5a017ddd7084aa28e2f36fac2d.tar.gz
llvm-de404a2809c8cd5a017ddd7084aa28e2f36fac2d.tar.bz2
llvm-de404a2809c8cd5a017ddd7084aa28e2f36fac2d.tar.xz
[lit] Move ManyTests examples to lit/examples/many-tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit/examples')
-rw-r--r--utils/lit/examples/README.txt7
-rw-r--r--utils/lit/examples/many-tests/README.txt10
-rw-r--r--utils/lit/examples/many-tests/lit.cfg23
3 files changed, 40 insertions, 0 deletions
diff --git a/utils/lit/examples/README.txt b/utils/lit/examples/README.txt
new file mode 100644
index 0000000000..a59daa8f77
--- /dev/null
+++ b/utils/lit/examples/README.txt
@@ -0,0 +1,7 @@
+==============
+ lit Examples
+==============
+
+This directory contains examples of 'lit' test suite configurations. The test
+suites they define can be run with 'lit examples/example-name', for more details
+see the README in each example.
diff --git a/utils/lit/examples/many-tests/README.txt b/utils/lit/examples/many-tests/README.txt
new file mode 100644
index 0000000000..6bffff1468
--- /dev/null
+++ b/utils/lit/examples/many-tests/README.txt
@@ -0,0 +1,10 @@
+========================
+ Many Tests lit Example
+========================
+
+This directory contains a trivial lit test suite configuration that defines a
+custom test format which just generates a large (N=10000) number of tests that
+do a small amount of work in the Python test execution code.
+
+This test suite is useful for testing the performance of lit on large numbers of
+tests.
diff --git a/utils/lit/examples/many-tests/lit.cfg b/utils/lit/examples/many-tests/lit.cfg
new file mode 100644
index 0000000000..8f7b940b6e
--- /dev/null
+++ b/utils/lit/examples/many-tests/lit.cfg
@@ -0,0 +1,23 @@
+# -*- Python -*-
+
+from lit import Test
+
+class ManyTests(object):
+ def __init__(self, N=10000):
+ self.N = N
+
+ def getTestsInDirectory(self, testSuite, path_in_suite,
+ litConfig, localConfig):
+ for i in range(self.N):
+ test_name = 'test-%04d' % (i,)
+ yield Test.Test(testSuite, path_in_suite + (test_name,),
+ localConfig)
+
+ def execute(self, test, litConfig):
+ # Do a "non-trivial" amount of Python work.
+ sum = 0
+ for i in range(10000):
+ sum += i
+ return Test.PASS,''
+
+config.test_format = ManyTests()