mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 02:46:06 +00:00

LLVM lit assumes control of the test parallelism when running a test suite. This style of testing doesn't play nicely with build systems like Buck or Bazel since it prefers finer grained actions on a per-test level. In order for external build systems to control the test parallelism, add an option to disable `.lit_test_times.txt` under the `--skip-test-time-recording` flag, thus allowing other build systems to determine the parallelism and avoid race conditions when writing to that file. I went for `--skip-test-time-recording` instead of `--time-tests` in order to preserve the original functionality of writing to `.lit_test_times.txt` as the default behavior and only opt-in for those who do _not_ want `.lit_test_times.txt` file.
16 lines
712 B
Python
16 lines
712 B
Python
## Check that --skip-test-time-recording skips .lit_test_times.txt recording.
|
|
|
|
# RUN: %{lit-no-order-opt} --skip-test-time-recording %{inputs}/time-tests
|
|
# RUN: not ls %{inputs}/time-tests/.lit_test_times.txt
|
|
|
|
## Check that --time-tests generates a printed histogram.
|
|
|
|
# RUN: %{lit-no-order-opt} --time-tests %{inputs}/time-tests > %t.out
|
|
# RUN: FileCheck < %t.out %s
|
|
# RUN: rm %{inputs}/time-tests/.lit_test_times.txt
|
|
|
|
# CHECK: Tests Times:
|
|
# CHECK-NEXT: --------------------------------------------------------------------------
|
|
# CHECK-NEXT: [ Range ] :: [ Percentage ] :: [Count]
|
|
# CHECK-NEXT: --------------------------------------------------------------------------
|