diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-28 16:28:58 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-28 16:28:58 +0000 |
commit | b543c168690faa6261a4e0ae817b6a2f79b9948a (patch) | |
tree | a18708bf2245219ca08371106f504ce52b48766c /lldb/packages/Python | |
parent | af0bd41e064f4608da29e741ad45fc4a6ef3abac (diff) | |
download | bcm5719-llvm-b543c168690faa6261a4e0ae817b6a2f79b9948a.tar.gz bcm5719-llvm-b543c168690faa6261a4e0ae817b6a2f79b9948a.zip |
[dotest] Remove -q (quiet) flag.
This patch removes the -q (quiet) flag and changing the default
behavior. Currently the flag serves two purposes that are somewhat
contradictory, as illustrated by the difference between the argument
name (quiet) and the configuration flag (parsable). On the one hand it
reduces output, but on the other hand it prints more output, like the
result of individual tests. My proposal is to guard the extra output
behind the verbose flag and always print the individual test results.
Differential revision: https://reviews.llvm.org/D66837
llvm-svn: 370226
Diffstat (limited to 'lldb/packages/Python')
4 files changed, 28 insertions, 48 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index 5574f71de3f..beb884e09aa 100644 --- a/lldb/packages/Python/lldbsuite/test/configuration.py +++ b/lldb/packages/Python/lldbsuite/test/configuration.py @@ -57,10 +57,6 @@ cflags_extras = '' # The filters (testclass.testmethod) used to admit tests into our test suite. filters = [] -# Parsable mode silences headers, and any other output this script might generate, and instead -# prints machine-readable output similar to what clang tests produce. -parsable = False - # The regular expression pattern to match against eligible filenames as # our test cases. regexp = None diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 7d7f823f237..d9e5980b3f3 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -252,7 +252,7 @@ def parseOptionsAndInitTestdirs(): if args.set_inferior_env_vars: lldbtest_config.inferior_env = ' '.join(args.set_inferior_env_vars) - # only print the args if being verbose (and parsable is off) + # Only print the args if being verbose. if args.v and not args.q: print(sys.argv) @@ -393,9 +393,6 @@ def parseOptionsAndInitTestdirs(): usage(parser) configuration.regexp = args.p - if args.q: - configuration.parsable = True - if args.s: if args.s.startswith('-'): usage(parser) @@ -1268,7 +1265,7 @@ def run_suite(): # checkCompiler() - if not configuration.parsable: + if configuration.verbose: print("compiler=%s" % configuration.compiler) # Iterating over all possible architecture and compiler combinations. @@ -1286,27 +1283,22 @@ def run_suite(): configPostfix = configString.translate(tbl) # Output the configuration. - if not configuration.parsable: + if configuration.verbose: sys.stderr.write("\nConfiguration: " + configString + "\n") # First, write out the number of collected test cases. - if not configuration.parsable: + if configuration.verbose: sys.stderr.write(configuration.separator + "\n") sys.stderr.write( "Collected %d test%s\n\n" % (configuration.suite.countTestCases(), configuration.suite.countTestCases() != 1 and "s" or "")) - if configuration.parsable: - v = 0 - else: - v = configuration.verbose - # Invoke the test runner. if configuration.count == 1: result = unittest2.TextTestRunner( stream=sys.stderr, - verbosity=v, + verbosity=configuration.verbose, resultclass=test_result.LLDBTestResult).run( configuration.suite) else: @@ -1318,13 +1310,13 @@ def run_suite(): result = unittest2.TextTestRunner( stream=sys.stderr, - verbosity=v, + verbosity=configuration.verbose, resultclass=test_result.LLDBTestResult).run( configuration.suite) configuration.failed = not result.wasSuccessful() - if configuration.sdir_has_content and not configuration.parsable: + 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" % diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py index 628aa411991..444f4afdf52 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest_args.py +++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py @@ -191,7 +191,6 @@ def create_parser(): # Test-suite behaviour group = parser.add_argument_group('Runtime behaviour options') X('-d', 'Suspend the process after launch to wait indefinitely for a debugger to attach') - X('-q', "Don't print extra output from this script.") X('-t', 'Turn on tracing of lldb command and other detailed test executions') group.add_argument( '-u', diff --git a/lldb/packages/Python/lldbsuite/test/test_result.py b/lldb/packages/Python/lldbsuite/test/test_result.py index bd1f939017c..8573b3b6be6 100644 --- a/lldb/packages/Python/lldbsuite/test/test_result.py +++ b/lldb/packages/Python/lldbsuite/test/test_result.py @@ -180,10 +180,9 @@ class LLDBTestResult(unittest2.TextTestResult): return super(LLDBTestResult, self).addSuccess(test) - if configuration.parsable: - self.stream.write( - "PASS: LLDB (%s) :: %s\n" % - (self._config_string(test), str(test))) + self.stream.write( + "PASS: LLDB (%s) :: %s\n" % + (self._config_string(test), str(test))) if self.results_formatter: self.results_formatter.handle_event( EventBuilder.event_for_success(test)) @@ -220,10 +219,9 @@ class LLDBTestResult(unittest2.TextTestResult): method = getattr(test, "markError", None) if method: method() - if configuration.parsable: - self.stream.write( - "FAIL: LLDB (%s) :: %s\n" % - (self._config_string(test), str(test))) + self.stream.write( + "FAIL: LLDB (%s) :: %s\n" % + (self._config_string(test), str(test))) if self.results_formatter: # Handle build errors as a separate event type if self._isBuildError(err): @@ -238,10 +236,9 @@ class LLDBTestResult(unittest2.TextTestResult): method = getattr(test, "markCleanupError", None) if method: method() - if configuration.parsable: - self.stream.write( - "CLEANUP ERROR: LLDB (%s) :: %s\n" % - (self._config_string(test), str(test))) + self.stream.write( + "CLEANUP ERROR: LLDB (%s) :: %s\n" % + (self._config_string(test), str(test))) if self.results_formatter: self.results_formatter.handle_event( EventBuilder.event_for_cleanup_error( @@ -258,10 +255,9 @@ class LLDBTestResult(unittest2.TextTestResult): method = getattr(test, "markFailure", None) if method: method() - if configuration.parsable: - self.stream.write( - "FAIL: LLDB (%s) :: %s\n" % - (self._config_string(test), str(test))) + self.stream.write( + "FAIL: LLDB (%s) :: %s\n" % + (self._config_string(test), str(test))) if configuration.useCategories: test_categories = self.getCategoriesForTest(test) for category in test_categories: @@ -280,10 +276,9 @@ class LLDBTestResult(unittest2.TextTestResult): method = getattr(test, "markExpectedFailure", None) if method: method(err, bugnumber) - if configuration.parsable: - self.stream.write( - "XFAIL: LLDB (%s) :: %s\n" % - (self._config_string(test), str(test))) + self.stream.write( + "XFAIL: LLDB (%s) :: %s\n" % + (self._config_string(test), str(test))) if self.results_formatter: self.results_formatter.handle_event( EventBuilder.event_for_expected_failure( @@ -295,10 +290,9 @@ class LLDBTestResult(unittest2.TextTestResult): method = getattr(test, "markSkippedTest", None) if method: method() - if configuration.parsable: - self.stream.write( - "UNSUPPORTED: LLDB (%s) :: %s (%s) \n" % - (self._config_string(test), str(test), reason)) + self.stream.write( + "UNSUPPORTED: LLDB (%s) :: %s (%s) \n" % + (self._config_string(test), str(test), reason)) if self.results_formatter: self.results_formatter.handle_event( EventBuilder.event_for_skip(test, reason)) @@ -309,10 +303,9 @@ class LLDBTestResult(unittest2.TextTestResult): method = getattr(test, "markUnexpectedSuccess", None) if method: method(bugnumber) - if configuration.parsable: - self.stream.write( - "XPASS: LLDB (%s) :: %s\n" % - (self._config_string(test), str(test))) + self.stream.write( + "XPASS: LLDB (%s) :: %s\n" % + (self._config_string(test), str(test))) if self.results_formatter: self.results_formatter.handle_event( EventBuilder.event_for_unexpected_success( |