From ab320a673fab8b2ba3106fbaad39c203925d7dfc Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 9 Aug 2013 21:39:28 +0000 Subject: [lit] Move ManyTests examples to lit/examples/many-tests. llvm-svn: 188109 --- llvm/utils/lit/examples/README.txt | 7 +++++++ llvm/utils/lit/examples/many-tests/README.txt | 10 ++++++++++ llvm/utils/lit/examples/many-tests/lit.cfg | 23 ++++++++++++++++++++++ .../lit/lit/ExampleTests/ManyTests/lit.local.cfg | 23 ---------------------- 4 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 llvm/utils/lit/examples/README.txt create mode 100644 llvm/utils/lit/examples/many-tests/README.txt create mode 100644 llvm/utils/lit/examples/many-tests/lit.cfg delete mode 100644 llvm/utils/lit/lit/ExampleTests/ManyTests/lit.local.cfg (limited to 'llvm/utils/lit') diff --git a/llvm/utils/lit/examples/README.txt b/llvm/utils/lit/examples/README.txt new file mode 100644 index 00000000000..a59daa8f770 --- /dev/null +++ b/llvm/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/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() diff --git a/llvm/utils/lit/lit/ExampleTests/ManyTests/lit.local.cfg b/llvm/utils/lit/lit/ExampleTests/ManyTests/lit.local.cfg deleted file mode 100644 index 6cc47522b16..00000000000 --- a/llvm/utils/lit/lit/ExampleTests/ManyTests/lit.local.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# -*- Python -*- - -Test = lit.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() -- cgit v1.2.3