diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 00:37:15 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 00:37:15 +0000 |
commit | 128ce319ec47c46dc7da16aa3a75185899878745 (patch) | |
tree | db62863e5742435e579ab8ee3008afb148cc4163 /utils/lit | |
parent | 38649827c38a4fcb93219eb29e104c91b0228e56 (diff) | |
download | external_llvm-128ce319ec47c46dc7da16aa3a75185899878745.zip external_llvm-128ce319ec47c46dc7da16aa3a75185899878745.tar.gz external_llvm-128ce319ec47c46dc7da16aa3a75185899878745.tar.bz2 |
[lit] Rename lit.{TestFormats,Util} to their aliased names {formats,util}.
- With compatibility hack in lit.__init__, so this hopefully shouldn't break
anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/LitConfig.py | 16 | ||||
-rw-r--r-- | utils/lit/lit/ShUtil.py | 8 | ||||
-rw-r--r-- | utils/lit/lit/TestRunner.py | 6 | ||||
-rw-r--r-- | utils/lit/lit/__init__.py | 4 | ||||
-rw-r--r-- | utils/lit/lit/formats.py (renamed from utils/lit/lit/TestFormats.py) | 4 | ||||
-rwxr-xr-x | utils/lit/lit/main.py | 6 | ||||
-rw-r--r-- | utils/lit/lit/util.py (renamed from utils/lit/lit/Util.py) | 0 |
7 files changed, 24 insertions, 20 deletions
diff --git a/utils/lit/lit/LitConfig.py b/utils/lit/lit/LitConfig.py index bcaea13..4b312e2 100644 --- a/utils/lit/lit/LitConfig.py +++ b/utils/lit/lit/LitConfig.py @@ -4,9 +4,9 @@ import os import sys import lit.Test -import lit.TestFormats +import lit.formats import lit.TestingConfig -import lit.Util +import lit.util class LitConfig: """LitConfig - Configuration data for a 'lit' test runner instance, shared @@ -22,10 +22,10 @@ class LitConfig: Test = lit.Test # Provide access to built-in formats. - formats = lit.TestFormats + formats = lit.formats # Provide access to built-in utility functions. - util = lit.Util + util = lit.util def __init__(self, progname, path, quiet, useValgrind, valgrindLeakCheck, valgrindArgs, @@ -80,7 +80,7 @@ class LitConfig: if self.bashPath is not None: return self.bashPath - self.bashPath = lit.Util.which('bash', os.pathsep.join(self.path)) + self.bashPath = lit.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', '/usr/local/bin/bash'): @@ -96,13 +96,13 @@ class LitConfig: def getToolsPath(self, dir, paths, tools): if dir is not None and os.path.isabs(dir) and os.path.isdir(dir): - if not lit.Util.checkToolsPath(dir, tools): + if not lit.util.checkToolsPath(dir, tools): return None else: - dir = lit.Util.whichTools(tools, paths) + dir = lit.util.whichTools(tools, paths) # bash - self.bashPath = lit.Util.which('bash', dir) + self.bashPath = lit.util.which('bash', dir) if self.bashPath is None: self.note("Unable to find 'bash.exe'.") self.bashPath = '' diff --git a/utils/lit/lit/ShUtil.py b/utils/lit/lit/ShUtil.py index fb0689b..1945ba7 100644 --- a/utils/lit/lit/ShUtil.py +++ b/utils/lit/lit/ShUtil.py @@ -1,7 +1,7 @@ from __future__ import absolute_import import itertools -import lit.Util +import lit.util from lit.ShCommands import Command, Pipeline, Seq class ShLexer: @@ -75,7 +75,7 @@ class ShLexer: # Outside of a string, '\\' escapes everything. self.eat() if self.pos == self.end: - lit.Util.warning( + lit.util.warning( "escape at end of quoted argument in: %r" % self.data) return str str += self.eat() @@ -93,7 +93,7 @@ class ShLexer: # Inside a '"' quoted string, '\\' only escapes the quote # character and backslash, otherwise it is preserved. if self.pos == self.end: - lit.Util.warning( + lit.util.warning( "escape at end of quoted argument in: %r" % self.data) return str c = self.eat() @@ -105,7 +105,7 @@ class ShLexer: str += '\\' + c else: str += c - lit.Util.warning("missing quote character in %r" % self.data) + lit.util.warning("missing quote character in %r" % self.data) return str def lex_arg_checked(self, c): diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 27e29b7..8929c0b 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -10,7 +10,7 @@ except ImportError: import lit.ShUtil as ShUtil import lit.Test as Test -import lit.Util as Util +import lit.util class InternalShellError(Exception): def __init__(self, command, message): @@ -154,7 +154,7 @@ def executeShCmd(cmd, cfg, cwd, results): # Resolve the executable path ourselves. args = list(j.args) - args[0] = Util.which(args[0], cfg.environment['PATH']) + args[0] = lit.util.which(args[0], cfg.environment['PATH']) if not args[0]: raise InternalShellError(j, '%r: command not found' % j.args[0]) @@ -472,7 +472,7 @@ def executeShTest(test, litConfig, useExternalSh, return (Test.PASS, '') # Create the output directory if it does not already exist. - Util.mkdir_p(os.path.dirname(tmpBase)) + lit.util.mkdir_p(os.path.dirname(tmpBase)) if useExternalSh: res = executeScript(test, litConfig, tmpBase, script, execdir) diff --git a/utils/lit/lit/__init__.py b/utils/lit/lit/__init__.py index 3967fdd..7b39cc5 100644 --- a/utils/lit/lit/__init__.py +++ b/utils/lit/lit/__init__.py @@ -9,3 +9,7 @@ __versioninfo__ = (0, 3, 0) __version__ = '.'.join(str(v) for v in __versioninfo__) + 'dev' __all__ = [] + +# Compatibility hacks for old names. +from . import util as Util +from . import formats as TestFormats diff --git a/utils/lit/lit/TestFormats.py b/utils/lit/lit/formats.py index 9c43a21..7a93adf 100644 --- a/utils/lit/lit/TestFormats.py +++ b/utils/lit/lit/formats.py @@ -4,7 +4,7 @@ import sys import lit.Test import lit.TestRunner -import lit.Util +import lit.util kIsWindows = sys.platform in ['win32', 'cygwin'] @@ -28,7 +28,7 @@ class GoogleTest(object): localConfig: TestingConfig instance""" try: - lines = lit.Util.capture([path, '--gtest_list_tests'], + lines = lit.util.capture([path, '--gtest_list_tests'], env=localConfig.environment) lines = lines.decode('ascii') if kIsWindows: diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py index 767fe10..fb3614a 100755 --- a/utils/lit/lit/main.py +++ b/utils/lit/lit/main.py @@ -12,7 +12,7 @@ import math, os, platform, random, re, sys, time, threading, traceback import lit.ProgressBar import lit.LitConfig import lit.Test -import lit.Util +import lit.util import lit.discovery @@ -255,7 +255,7 @@ def main(builtinParameters = {}): # I haven't seen this bug occur with 2.5.2 and later, so only enable multiple # threads by default there. if sys.hexversion >= 0x2050200: - opts.numThreads = lit.Util.detectCPUs() + opts.numThreads = lit.util.detectCPUs() else: opts.numThreads = 1 @@ -417,7 +417,7 @@ def main(builtinParameters = {}): byTime = list(times.items()) byTime.sort(key = lambda item: item[1]) if byTime: - lit.Util.printHistogram(byTime, title='Tests') + lit.util.printHistogram(byTime, title='Tests') for name,code in (('Expected Passes ', lit.Test.PASS), ('Expected Failures ', lit.Test.XFAIL), diff --git a/utils/lit/lit/Util.py b/utils/lit/lit/util.py index d7d6d7f..d7d6d7f 100644 --- a/utils/lit/lit/Util.py +++ b/utils/lit/lit/util.py |