diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 21:39:28 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 21:39:28 +0000 |
commit | ab320a673fab8b2ba3106fbaad39c203925d7dfc (patch) | |
tree | 6922cef2a57de6dabb3d594bf1732ca29c057a5a /llvm/utils/lit/examples/many-tests | |
parent | c38c6f068bc64b628e1519abc3447229c61ed2de (diff) | |
download | bcm5719-llvm-ab320a673fab8b2ba3106fbaad39c203925d7dfc.tar.gz bcm5719-llvm-ab320a673fab8b2ba3106fbaad39c203925d7dfc.zip |
[lit] Move ManyTests examples to lit/examples/many-tests.
llvm-svn: 188109
Diffstat (limited to 'llvm/utils/lit/examples/many-tests')
-rw-r--r-- | llvm/utils/lit/examples/many-tests/README.txt | 10 | ||||
-rw-r--r-- | llvm/utils/lit/examples/many-tests/lit.cfg | 23 |
2 files changed, 33 insertions, 0 deletions
diff --git a/llvm/utils/lit/examples/many-tests/README.txt b/llvm/utils/lit/examples/many-tests/README.txt new file mode 100644 index 00000000000..6bffff1468c --- /dev/null +++ b/llvm/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/llvm/utils/lit/examples/many-tests/lit.cfg b/llvm/utils/lit/examples/many-tests/lit.cfg new file mode 100644 index 00000000000..8f7b940b6ea --- /dev/null +++ b/llvm/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() |