Skip to content

Conversation

hnrklssn
Copy link
Member

This allows the user to silence lit's note and warn diagnostics with --quiet/-q, but still get test output with --verbose/-v or --show-all/-a.

Previously -v and -a silently did nothing when combined with -q, regardless of the order they appeared in.

This fixes #106643

This allows the user to silence lit's note and warn diagnostics with --quiet/-q, but still get test output with --verbose/-v or --show-all/-a. Previously -v and -a silently did nothing when combined with -q, regardless of the order they appeared in. This fixes llvm#106643
@llvmbot
Copy link
Member

llvmbot commented Aug 30, 2024

@llvm/pr-subscribers-testing-tools

Author: Henrik G. Olsson (hnrklssn)

Changes

This allows the user to silence lit's note and warn diagnostics with --quiet/-q, but still get test output with --verbose/-v or --show-all/-a.

Previously -v and -a silently did nothing when combined with -q, regardless of the order they appeared in.

This fixes #106643


Full diff: https://github.com/llvm/llvm-project/pull/106668.diff

2 Files Affected:

  • (modified) llvm/utils/lit/lit/display.py (+2-1)
  • (modified) llvm/utils/lit/tests/shtest-output-printing.py (+4)
diff --git a/llvm/utils/lit/lit/display.py b/llvm/utils/lit/lit/display.py index 7de5a298d2302b..1cdabd57371d96 100644 --- a/llvm/utils/lit/lit/display.py +++ b/llvm/utils/lit/lit/display.py @@ -2,7 +2,7 @@ def create_display(opts, tests, total_tests, workers): - if opts.quiet: + if opts.quiet and not (opts.showOutput or opts.showAllOutput): return NopDisplay() num_tests = len(tests) @@ -97,6 +97,7 @@ def update(self, test): show_result = ( test.isFailure() or self.opts.showAllOutput + or self.opts.showOutput or (not self.opts.quiet and not self.opts.succinct) ) if show_result: diff --git a/llvm/utils/lit/tests/shtest-output-printing.py b/llvm/utils/lit/tests/shtest-output-printing.py index 129cff981eb5b2..728d2b24425079 100644 --- a/llvm/utils/lit/tests/shtest-output-printing.py +++ b/llvm/utils/lit/tests/shtest-output-printing.py @@ -3,6 +3,10 @@ # RUN: not %{lit} -v %{inputs}/shtest-output-printing > %t.out # RUN: FileCheck --input-file %t.out --match-full-lines %s # +# Check that -q doesn't override -v +# RUN: not %{lit} -v -q %{inputs}/shtest-output-printing > %t.out +# RUN: FileCheck --input-file %t.out --match-full-lines %s +# # END. # CHECK: -- Testing: {{.*}} 
@hnrklssn hnrklssn closed this Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants