llvm.org GIT mirror llvm / cdb6339
[lit] Hack lit to allow a test suite to request that it is run "early". This lets us for example start running the unit test suite early. For 'check-llvm' on my machine, this drops the tim e from 44s to 32s!!!!! It's pretty ugly. I barely know how to write Python, so feel free to just tell me how I should write it instead. =D Thanks to Filipe and others for help. Differential Revision: http://reviews.llvm.org/D18089 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263329 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 3 years ago
4 changed file(s) with 17 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1010
1111 # suffixes: A list of file extensions to treat as test files.
1212 config.suffixes = []
13
14 # is_early; Request to run this suite early.
15 config.is_early = True
1316
1417 # test_source_root: The root path where tests are located.
1518 # test_exec_root: The root path where tests should be run.
234234
235235 return False
236236
237 def isEarlyTest(self):
238 """
239 isEarlyTest() -> bool
240
241 Check whether this test should be executed early in a particular run.
242 This can be used for test suites with long running tests to maximize
243 parallelism or where it is desirable to surface their failures early.
244 """
245 return self.suite.config.is_early
237246
238247 def getJUnitXML(self):
239248 test_name = self.path_in_suite[-1]
117117 def __init__(self, parent, name, suffixes, test_format,
118118 environment, substitutions, unsupported,
119119 test_exec_root, test_source_root, excludes,
120 available_features, pipefail, limit_to_features = []):
120 available_features, pipefail, limit_to_features = [],
121 is_early = False):
121122 self.parent = parent
122123 self.name = str(name)
123124 self.suffixes = set(suffixes)
134135 # require one of the features in this list if this list is non-empty.
135136 # Configurations can set this list to restrict the set of tests to run.
136137 self.limit_to_features = set(limit_to_features)
138 # Whether the suite should be tested early in a given run.
139 self.is_early = bool(is_early)
137140
138141 def finish(self, litConfig):
139142 """finish() - Finish this config object, after loading is complete."""
366366 elif opts.incremental:
367367 sort_by_incremental_cache(run)
368368 else:
369 run.tests.sort(key = lambda result_test: result_test.getFullName())
369 run.tests.sort(key = lambda t: (not t.isEarlyTest(), t.getFullName()))
370370
371371 # Finally limit the number of tests, if desired.
372372 if opts.maxTests is not None: