
This patch adds a -r|--relative-paths option to llvm-lit, which when enabled will print test case names using paths relative to the current working directory. The legacy default without that option is that test cases are identified using a path relative to the test suite. Only the summary report is impacted. That normally include failed tests, unless unless options such as --show-pass. Background to this patch was the discussion here https://discourse.llvm.org/t/test-case-paths-in-llvm-lit-output-are-lacking-the-location-of-the-test-dir-itself/87973 with a goal to making it easier to copy-n-paste the path to the failing test cases. Examples showing difference in "Passed Tests" and "Failed Tests": > llvm-lit --show-pass test/Transforms/Foo PASS: LLVM :: Transforms/Foo/test1.txt (1 of 2) FAIL: LLVM :: Transforms/Foo/test2.txt (2 of 2) Passed Tests (1): LLVM :: Transforms/Foo/test1.txt Failed Tests (1): LLVM :: Transforms/Foo/test2.txt > llvm-lit --show-pass --relative-paths test/Transforms/Foo PASS: LLVM :: Transforms/Foo/test1.txt (1 of 2) FAIL: LLVM :: Transforms/Foo/test2.txt (2 of 2) Passed Tests (1): test/Transforms/Foo/test1.txt Failed Tests (1): test/Transforms/Foo/test2.txt
19 lines
981 B
Python
19 lines
981 B
Python
# RUN: %{lit} --ignore-fail --show-pass %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-DEFAULT %s
|
|
# RUN: %{lit} --ignore-fail --show-pass -r %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-RELATIVE %s
|
|
# RUN: %{lit} --ignore-fail --show-pass --relative-paths %{inputs}/print-relative-path | FileCheck --check-prefix=CHECK-RELATIVE %s
|
|
|
|
|
|
# CHECK-DEFAULT: PASS: print-relative-path :: test.txt (1 of 2)
|
|
# CHECK-DEFAULT: FAIL: print-relative-path :: test2.txt (2 of 2)
|
|
# CHECK-DEFAULT: Passed Tests (1):
|
|
# CHECK-DEFAULT: print-relative-path :: test.txt
|
|
# CHECK-DEFAULT: Failed Tests (1):
|
|
# CHECK-DEFAULT: print-relative-path :: test2.txt
|
|
|
|
# CHECK-RELATIVE: PASS: print-relative-path :: test.txt (1 of 2)
|
|
# CHECK-RELATIVE: FAIL: print-relative-path :: test2.txt (2 of 2)
|
|
# CHECK-RELATIVE: Passed Tests (1):
|
|
# CHECK-RELATIVE: Inputs/print-relative-path/test.txt
|
|
# CHECK-RELATIVE: Failed Tests (1):
|
|
# CHECK-RELATIVE: Inputs/print-relative-path/test2.txt
|