[PATCH] D68220: [LNT] Python 3 support: stable showtests output

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 06:55:31 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.

lnt showtests output depends on the iteration order of a set, which has
no guarantee whatsoever. This makes the result of test
tests/lnttool/showtests.shtest unstable in particular accross Python 2
and 3. This commit makes the lnt.tests constructor return a new sorted
list instead of the set, thus guaranteeing a stable output of lnt
showtests. It also lists tests in alphabetical order which makes it
nicer for users.


https://reviews.llvm.org/D68220

Files:
  lnt/tests/__init__.py
  tests/lnttool/showtests.shtest


Index: tests/lnttool/showtests.shtest
===================================================================
--- tests/lnttool/showtests.shtest
+++ tests/lnttool/showtests.shtest
@@ -1,5 +1,5 @@
 # RUN: lnt showtests | FileCheck %s
 # CHECK: Available tests:
 # CHECK-NEXT: compile    - Single file compile-time performance testing
-# CHECK-NEXT: test_suite - LLVM test-suite
 # CHECK-NEXT: nt         - LLVM test-suite compile and execution tests
+# CHECK-NEXT: test_suite - LLVM test-suite
Index: lnt/tests/__init__.py
===================================================================
--- lnt/tests/__init__.py
+++ lnt/tests/__init__.py
@@ -12,7 +12,7 @@
 
     Return the list of known built-in test names.
     """
-    return _known_tests
+    return sorted(_known_tests)
 
 
 def get_module(name):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68220.222416.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190930/99380611/attachment.bin>


More information about the llvm-commits mailing list