Skip to content

Commit a1d1cbe

Browse files
committed
Only impact summary report, skip "suite :: " prefix
Fixup to only impact paths in the summary report (undoing changes in display.py). Also skipping the "suite :: " prefix in such output.
1 parent fa9011e commit a1d1cbe

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

llvm/utils/lit/lit/Test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ def isFailure(self):
307307
def getFullName(self):
308308
return self.suite.config.name + " :: " + "/".join(self.path_in_suite)
309309

310-
def getFullNameRelPath(self, printRelativePaths):
311-
if printRelativePaths:
312-
return self.suite.config.name + " :: " + os.path.relpath(self.getFilePath())
310+
def getSummaryName(self, printPathRelativeCWD):
311+
if printPathRelativeCWD:
312+
return os.path.relpath(self.getFilePath())
313313
return self.getFullName()
314314

315315
def getFilePath(self):

llvm/utils/lit/lit/cl_arguments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def parse_args():
9494
format_group.add_argument(
9595
"-r",
9696
"--relative-paths",
97-
dest="printRelativePaths",
97+
dest="printPathRelativeCWD",
9898
help="Print paths relative to CWD",
9999
action="store_true",
100100
)

llvm/utils/lit/lit/display.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def clear(self, interrupted):
116116

117117
def print_result(self, test):
118118
# Show the test result line.
119-
test_name = test.getFullNameRelPath(self.opts.printRelativePaths)
119+
test_name = test.getFullName()
120120

121121
extra_info = ""
122122
if test.result.attempts > 1:

llvm/utils/lit/lit/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,21 +329,21 @@ def print_results(tests, elapsed, opts):
329329
sorted(tests_by_code[code], key=lambda t: t.getFullName()),
330330
code,
331331
opts.shown_codes,
332-
opts.printRelativePaths,
332+
opts.printPathRelativeCWD,
333333
)
334334

335335
print_summary(total_tests, tests_by_code, opts.quiet, elapsed)
336336

337337

338-
def print_group(tests, code, shown_codes, printRelativePaths):
338+
def print_group(tests, code, shown_codes, printPathRelativeCWD):
339339
if not tests:
340340
return
341341
if not code.isFailure and code not in shown_codes:
342342
return
343343
print("*" * 20)
344344
print("{} Tests ({}):".format(code.label, len(tests)))
345345
for test in tests:
346-
print(" %s" % test.getFullNameRelPath(printRelativePaths))
346+
print(" %s" % test.getSummaryName(printPathRelativeCWD))
347347
sys.stdout.write("\n")
348348

349349

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# RUN: not %{lit} %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-DEFAULT %s
2-
# RUN: not %{lit} -r %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-RELATIVE %s
3-
# RUN: not %{lit} --relative-paths %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-RELATIVE %s
1+
# RUN: %{lit} --ignore-fail --show-pass %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-DEFAULT %s
2+
# RUN: %{lit} --ignore-fail --show-pass -r %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-RELATIVE %s
3+
# RUN: %{lit} --ignore-fail --show-pass --relative-paths %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-RELATIVE %s
44

55

66
# CHECK-DEFAULT: PASS: print-relative-path :: test.txt (1 of 2)
7-
# CHECK-DEFAULT-NEXT: FAIL: print-relative-path :: test2.txt (2 of 2)
8-
# CHECK-DEFAULT-NEXT: ********************
9-
# CHECK-DEFAULT-NEXT: Failed Tests (1):
10-
# CHECK-DEFAULT-NEXT: print-relative-path :: test2.txt
7+
# CHECK-DEFAULT: FAIL: print-relative-path :: test2.txt (2 of 2)
8+
# CHECK-DEFAULT: Passed Tests (1):
9+
# CHECK-DEFAULT: print-relative-path :: test.txt
10+
# CHECK-DEFAULT: Failed Tests (1):
11+
# CHECK-DEFAULT: print-relative-path :: test2.txt
1112

12-
# CHECK-RELATIVE: PASS: print-relative-path :: Inputs/print-relative-path/test.txt (1 of 2)
13-
# CHECK-RELATIVE-NEXT: FAIL: print-relative-path :: Inputs/print-relative-path/test2.txt (2 of 2)
14-
# CHECK-RELATIVE-NEXT: ********************
15-
# CHECK-RELATIVE-NEXT: Failed Tests (1):
16-
# CHECK-RELATIVE-NEXT: print-relative-path :: Inputs/print-relative-path/test2.txt
13+
# CHECK-RELATIVE: PASS: print-relative-path :: test.txt (1 of 2)
14+
# CHECK-RELATIVE: FAIL: print-relative-path :: test2.txt (2 of 2)
15+
# CHECK-RELATIVE: Passed Tests (1):
16+
# CHECK-RELATIVE: Inputs/print-relative-path/test.txt
17+
# CHECK-RELATIVE: Failed Tests (1):
18+
# CHECK-RELATIVE: Inputs/print-relative-path/test2.txt

0 commit comments

Comments
 (0)