Skip to content

Commit d55bb8c

Browse files
author
Thomas Preud'homme
committed
[LNT] Python 3 support: stable showtests output
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. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68220 llvm-svn: 374305
1 parent d76be6f commit d55bb8c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lnt/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def get_names():
1212
1313
Return the list of known built-in test names.
1414
"""
15-
return _known_tests
15+
return sorted(_known_tests)
1616

1717

1818
def get_module(name):

tests/lnttool/showtests.shtest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# RUN: lnt showtests | FileCheck %s
22
# CHECK: Available tests:
33
# CHECK-NEXT: compile - Single file compile-time performance testing
4-
# CHECK-NEXT: test_suite - LLVM test-suite
54
# CHECK-NEXT: nt - LLVM test-suite compile and execution tests
5+
# CHECK-NEXT: test_suite - LLVM test-suite

0 commit comments

Comments
 (0)