[llvm] b32fe2b - [NFC][lit] Add a test showing that timing data for tests not executed is lost

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 05:26:23 PDT 2021


Author: Roman Lebedev
Date: 2021-03-22T15:25:32+03:00
New Revision: b32fe2b5142e835597a15eb06c59191c4cf51b54

URL: https://github.com/llvm/llvm-project/commit/b32fe2b5142e835597a15eb06c59191c4cf51b54
DIFF: https://github.com/llvm/llvm-project/commit/b32fe2b5142e835597a15eb06c59191c4cf51b54.diff

LOG: [NFC][lit] Add a test showing that timing data for tests not executed is lost

I.e. when you first run lit on a directory, and then on a single test,
the timing knowledge about anything else other than that single test
is lost. This isn't right.

Added: 
    llvm/utils/lit/tests/Inputs/reorder/new-test.txt

Modified: 
    llvm/utils/lit/tests/Inputs/reorder/.lit_test_times.txt
    llvm/utils/lit/tests/reorder.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/tests/Inputs/reorder/.lit_test_times.txt b/llvm/utils/lit/tests/Inputs/reorder/.lit_test_times.txt
index 00aecc968ed3..73d55debc605 100644
--- a/llvm/utils/lit/tests/Inputs/reorder/.lit_test_times.txt
+++ b/llvm/utils/lit/tests/Inputs/reorder/.lit_test_times.txt
@@ -1,3 +1,4 @@
+42.0 not-executed.txt
 3.0 subdir/ccc.txt
 2.0 bbb.txt
 0.1 aaa.txt

diff  --git a/llvm/utils/lit/tests/Inputs/reorder/new-test.txt b/llvm/utils/lit/tests/Inputs/reorder/new-test.txt
new file mode 100644
index 000000000000..b80b60b7a279
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/reorder/new-test.txt
@@ -0,0 +1 @@
+# RUN: true

diff  --git a/llvm/utils/lit/tests/reorder.py b/llvm/utils/lit/tests/reorder.py
index 8e5ecda22219..d787112b18f2 100644
--- a/llvm/utils/lit/tests/reorder.py
+++ b/llvm/utils/lit/tests/reorder.py
@@ -1,13 +1,22 @@
 ## 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 | FileCheck %s
-# RUN: not 
diff  %{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=not-executed.txt < %{inputs}/reorder/.lit_test_times.txt.new %s
+# RUN: FileCheck < %t.out %s
 # END.
 
-# CHECK:     -- Testing: 3 tests, 1 workers --
+# TIMES: 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:     Passed: 3
+# CHECK-NEXT: PASS: reorder :: new-test.txt
+# CHECK:     Passed: 4


        


More information about the llvm-commits mailing list