[PATCH] D98767: [lit] Harmonize test timing data between Unix and Windows

David Zarzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 04:43:10 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2b20df2d798a: [lit] Harmonize test timing data between Unix and Windows (authored by davezarzycki).

Changed prior to commit:
  https://reviews.llvm.org/D98767?vs=331194&id=331225#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98767/new/

https://reviews.llvm.org/D98767

Files:
  llvm/utils/lit/lit/Test.py
  llvm/utils/lit/lit/main.py
  llvm/utils/lit/tests/reorder.py


Index: llvm/utils/lit/tests/reorder.py
===================================================================
--- llvm/utils/lit/tests/reorder.py
+++ llvm/utils/lit/tests/reorder.py
@@ -3,7 +3,6 @@
 # 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
-# UNSUPPORTED: system-windows
 # END.
 
 # CHECK:     -- Testing: 3 tests, 1 workers --
Index: llvm/utils/lit/lit/main.py
===================================================================
--- llvm/utils/lit/lit/main.py
+++ llvm/utils/lit/lit/main.py
@@ -264,7 +264,12 @@
         if not t.suite.exec_root in times_by_suite:
             times_by_suite[t.suite.exec_root] = []
         time = -t.result.elapsed if t.isFailure() else t.result.elapsed
-        times_by_suite[t.suite.exec_root].append((os.sep.join(t.path_in_suite), t.result.elapsed))
+        # The "path" here is only used as a key into a dictionary. It is never
+        # used as an actual path to a filesystem API, therefore we use '/' as
+        # the canonical separator so that Unix and Windows machines can share
+        # timing data.
+        times_by_suite[t.suite.exec_root].append(('/'.join(t.path_in_suite),
+          t.result.elapsed))
 
     for s, value in times_by_suite.items():
         try:
Index: llvm/utils/lit/lit/Test.py
===================================================================
--- llvm/utils/lit/lit/Test.py
+++ llvm/utils/lit/lit/Test.py
@@ -262,8 +262,8 @@
         # The previous test elapsed time, if applicable.
         self.previous_elapsed = 0.0
 
-        if os.sep.join(path_in_suite) in suite.test_times:
-            time = suite.test_times[os.sep.join(path_in_suite)]
+        if '/'.join(path_in_suite) in suite.test_times:
+            time = suite.test_times['/'.join(path_in_suite)]
             self.previous_elapsed = abs(time)
             self.previous_failure = time < 0
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98767.331225.patch
Type: text/x-patch
Size: 2040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210317/54cc08bb/attachment.bin>


More information about the llvm-commits mailing list