1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/utils/lit/tests/reorder.py
Roman Lebedev 61f46d53b3 [lit] Do not forget test times for tests that weren't executed
Even though we have read the times before,
we intentionally forget about it for performance reasons.
But that means we also forget all the times for the tests
that weren't executed this time. This is mildly inconvenient.

So, when recording the new times, first re-read the old times,
and update times for the tests that were executed,
thus preserving all original times, too.
2021-03-22 15:26:00 +03:00

24 lines
968 B
Python

## Check that we can reorder test runs.
# RUN: cp %{inputs}/reorder/.lit_test_times.txt %{inputs}/reorder/.lit_test_times.txt.orig
# RUN: %{lit} -j1 %{inputs}/reorder > %t.out
# RUN: cp %{inputs}/reorder/.lit_test_times.txt %{inputs}/reorder/.lit_test_times.txt.new
# RUN: cp %{inputs}/reorder/.lit_test_times.txt.orig %{inputs}/reorder/.lit_test_times.txt
# RUN: not diff %{inputs}/reorder/.lit_test_times.txt.new %{inputs}/reorder/.lit_test_times.txt.orig
# RUN: FileCheck --check-prefix=TIMES --implicit-check-not= < %{inputs}/reorder/.lit_test_times.txt.new %s
# RUN: FileCheck < %t.out %s
# END.
# TIMES: not-executed.txt
# TIMES-NEXT: subdir/ccc.txt
# TIMES-NEXT: bbb.txt
# TIMES-NEXT: aaa.txt
# TIMES-NEXT: new-test.txt
# CHECK: -- Testing: 4 tests, 1 workers --
# CHECK-NEXT: PASS: reorder :: subdir/ccc.txt
# CHECK-NEXT: PASS: reorder :: bbb.txt
# CHECK-NEXT: PASS: reorder :: aaa.txt
# CHECK-NEXT: PASS: reorder :: new-test.txt
# CHECK: Passed: 4