diff --git a/llvm/utils/lit/lit/Test.py b/llvm/utils/lit/lit/Test.py --- a/llvm/utils/lit/lit/Test.py +++ b/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 diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py --- a/llvm/utils/lit/lit/main.py +++ b/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: diff --git a/llvm/utils/lit/tests/reorder.py b/llvm/utils/lit/tests/reorder.py --- a/llvm/utils/lit/tests/reorder.py +++ b/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: windows # END. # CHECK: -- Testing: 3 tests, 1 workers --