diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-27 15:15:58 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-27 15:15:58 +0000 |
commit | abdf259d487163e72081a8cf4991b1617206b41e (patch) | |
tree | 9fad9a5d5dd8c4ff54af48edad9c8cc26dd5fda1 /utils/lit | |
parent | 59161dfae3225dd9151afbc76ca9074598c0c605 (diff) | |
download | src-abdf259d487163e72081a8cf4991b1617206b41e.tar.gz src-abdf259d487163e72081a8cf4991b1617206b41e.zip |
Update LLVM to r104832.vendor/llvm/llvm-r104832
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=208599
svn path=/vendor/llvm/llvm-r104832/; revision=208976; tag=vendor/llvm/llvm-r104832
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/LitConfig.py | 2 | ||||
-rw-r--r-- | utils/lit/lit/ShUtil.py | 7 | ||||
-rw-r--r-- | utils/lit/lit/TestFormats.py | 4 | ||||
-rwxr-xr-x | utils/lit/lit/lit.py | 25 |
4 files changed, 32 insertions, 6 deletions
diff --git a/utils/lit/lit/LitConfig.py b/utils/lit/lit/LitConfig.py index 9b62470902bd..ac4859137e54 100644 --- a/utils/lit/lit/LitConfig.py +++ b/utils/lit/lit/LitConfig.py @@ -71,7 +71,7 @@ class LitConfig: self.bashPath = Util.which('bash', os.pathsep.join(self.path)) if self.bashPath is None: # Check some known paths. - for path in ('/bin/bash', '/usr/bin/bash'): + for path in ('/bin/bash', '/usr/bin/bash', '/usr/local/bin/bash'): if os.path.exists(path): self.bashPath = path break diff --git a/utils/lit/lit/ShUtil.py b/utils/lit/lit/ShUtil.py index c8f933245d31..dda622a48a84 100644 --- a/utils/lit/lit/ShUtil.py +++ b/utils/lit/lit/ShUtil.py @@ -67,6 +67,9 @@ class ShLexer: elif c == '"': self.eat() str += self.lex_arg_quoted('"') + elif c == "'": + self.eat() + str += self.lex_arg_quoted("'") elif not self.win32Escapes and c == '\\': # Outside of a string, '\\' escapes everything. self.eat() @@ -287,6 +290,10 @@ class TestShParse(unittest.TestCase): Pipeline([Command(['echo', 'hello'], [])], False)) self.assertEqual(self.parse('echo ""'), Pipeline([Command(['echo', ''], [])], False)) + self.assertEqual(self.parse("""echo -DFOO='a'"""), + Pipeline([Command(['echo', '-DFOO=a'], [])], False)) + self.assertEqual(self.parse('echo -DFOO="a"'), + Pipeline([Command(['echo', '-DFOO=a'], [])], False)) def test_redirection(self): self.assertEqual(self.parse('echo hello > c'), diff --git a/utils/lit/lit/TestFormats.py b/utils/lit/lit/TestFormats.py index 5e1a811e6c77..e52d0e4e1c7c 100644 --- a/utils/lit/lit/TestFormats.py +++ b/utils/lit/lit/TestFormats.py @@ -183,8 +183,10 @@ class OneCommandPerFileTest: self.createTempInput(tmp, test) tmp.flush() cmd.append(tmp.name) - else: + elif hasattr(test, 'source_path'): cmd.append(test.source_path) + else: + cmd.append(test.getSourcePath()) out, err, exitCode = TestRunner.executeCommand(cmd) diff --git a/utils/lit/lit/lit.py b/utils/lit/lit/lit.py index a29fa42101cc..db0653f7966d 100755 --- a/utils/lit/lit/lit.py +++ b/utils/lit/lit/lit.py @@ -258,9 +258,10 @@ def getTestsInSuite(ts, path_in_suite, litConfig, lc = getLocalConfig(ts, path_in_suite, litConfig, localConfigCache) # Search for tests. - for res in lc.test_format.getTestsInDirectory(ts, path_in_suite, - litConfig, lc): - yield res + if lc.test_format is not None: + for res in lc.test_format.getTestsInDirectory(ts, path_in_suite, + litConfig, lc): + yield res # Search subdirectories. for filename in os.listdir(source_path): @@ -489,11 +490,27 @@ def main(): isWindows = (platform.system()=='Windows'), params = userParams) + # Expand '@...' form in inputs. + actual_inputs = [] + for input in inputs: + if os.path.exists(input) or not input.startswith('@'): + actual_inputs.append(input) + else: + f = open(input[1:]) + try: + for ln in f: + ln = ln.strip() + if ln: + actual_inputs.append(ln) + finally: + f.close() + + # Load the tests from the inputs. tests = [] testSuiteCache = {} localConfigCache = {} - for input in inputs: + for input in actual_inputs: prev = len(tests) tests.extend(getTests(input, litConfig, testSuiteCache, localConfigCache)[1]) |