diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/configuration.py | 14 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dotest.py | 19 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dotest_args.py | 10 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 46 |
4 files changed, 9 insertions, 80 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index 7939a27..db4262f 100644 --- a/lldb/packages/Python/lldbsuite/test/configuration.py +++ b/lldb/packages/Python/lldbsuite/test/configuration.py @@ -76,20 +76,6 @@ regexp = None skip_tests = None xfail_tests = None -# By default, recorded session info for errored/failed test are dumped into its -# own file under a session directory named after the timestamp of the test suite -# run. Use '-s session-dir-name' to specify a specific dir name. -sdir_name = None - -# Valid options: -# f - test file name (without extension) -# n - test class name -# m - test method name -# a - architecture -# c - compiler path -# The default is to write all fields. -session_file_format = 'fnmac' - # Set this flag if there is any session info dumped during the test run. sdir_has_content = False # svn_info stores the output from 'svn info lldb.base.dir'. diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 7c0a9ec..64a1978 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -388,14 +388,6 @@ def parseOptionsAndInitTestdirs(): usage(parser) configuration.regexp = args.p - if args.s: - configuration.sdir_name = args.s - else: - timestamp_started = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S") - configuration.sdir_name = os.path.join(os.getcwd(), timestamp_started) - - configuration.session_file_format = args.session_file_format - if args.t: os.environ['LLDB_COMMAND_TRACE'] = 'YES' @@ -972,14 +964,6 @@ def run_suite(): # Install the control-c handler. unittest2.signals.installHandler() - lldbutil.mkdir_p(configuration.sdir_name) - os.environ["LLDB_SESSION_DIRNAME"] = configuration.sdir_name - - sys.stderr.write( - "\nSession logs for test failures/errors/unexpected successes" - " will go into directory '%s'\n" % - configuration.sdir_name) - # # Invoke the default TextTestRunner to run the test suite # @@ -1033,8 +1017,7 @@ def run_suite(): if configuration.sdir_has_content and configuration.verbose: sys.stderr.write( "Session logs for test failures/errors/unexpected successes" - " can be found in directory '%s'\n" % - configuration.sdir_name) + " can be found in the test build directory\n") if configuration.use_categories and len( configuration.failures_per_category) > 0: diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py index 48d754e..c77f4c2 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest_args.py +++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py @@ -124,16 +124,6 @@ def create_parser(): action='append', help='Run "setting set SETTING VALUE" before executing any test.') group.add_argument( - '-s', - metavar='name', - help='Specify the name of the dir created to store the session files of tests with errored or failed status. If not specified, the test driver uses the timestamp as the session dir name') - group.add_argument( - '-S', - '--session-file-format', - default=configuration.session_file_format, - metavar='format', - help='Specify session file name format. See configuration.py for a description.') - group.add_argument( '-y', type=int, metavar='count', diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 7ba3a15..53d1aa4 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -868,6 +868,11 @@ class Base(unittest2.TestCase): # List of log files produced by the current test. self.log_files = [] + # Create the build directory. + # The logs are stored in the build directory, so we have to create it + # before creating the first log file. + self.makeBuildDir() + session_file = self.getLogBasenameForCurrentTest()+".log" self.log_files.append(session_file) @@ -930,8 +935,6 @@ class Base(unittest2.TestCase): self.lib_lldb = lib self.darwinWithFramework = self.platformIsDarwin() - self.makeBuildDir() - def setAsync(self, value): """ Sets async mode to True/False and ensures it is reset after the testcase completes.""" old_async = self.dbg.GetAsync() @@ -1156,45 +1159,12 @@ class Base(unittest2.TestCase): def getRerunArgs(self): return " -f %s.%s" % (self.__class__.__name__, self._testMethodName) - def getLogBasenameForCurrentTest(self, prefix=None): + def getLogBasenameForCurrentTest(self, prefix="Incomplete"): """ returns a partial path that can be used as the beginning of the name of multiple log files pertaining to this test - - <session-dir>/<arch>-<compiler>-<test-file>.<test-class>.<test-method> """ - dname = os.path.join(configuration.test_src_root, - os.environ["LLDB_SESSION_DIRNAME"]) - if not os.path.isdir(dname): - os.mkdir(dname) - - components = [] - if prefix is not None: - components.append(prefix) - for c in configuration.session_file_format: - if c == 'f': - components.append(self.__class__.__module__) - elif c == 'n': - components.append(self.__class__.__name__) - elif c == 'c': - compiler = self.getCompiler() - - if compiler[1] == ':': - compiler = compiler[2:] - if os.path.altsep is not None: - compiler = compiler.replace(os.path.altsep, os.path.sep) - path_components = [x for x in compiler.split(os.path.sep) if x != ""] - - # Add at most 4 path components to avoid generating very long - # filenames - components.extend(path_components[-4:]) - elif c == 'a': - components.append(self.getArchitecture()) - elif c == 'm': - components.append(self.testMethodName) - fname = "-".join(components) - - return os.path.join(dname, fname) + return os.path.join(self.getBuildDir(), prefix) def dumpSessionInfo(self): """ @@ -1254,7 +1224,7 @@ class Base(unittest2.TestCase): # process the log files if prefix != 'Success' or lldbtest_config.log_success: # keep all log files, rename them to include prefix - src_log_basename = self.getLogBasenameForCurrentTest(None) + src_log_basename = self.getLogBasenameForCurrentTest() dst_log_basename = self.getLogBasenameForCurrentTest(prefix) for src in self.log_files: if os.path.isfile(src): |