scripts/mtest2make: ensure output has stable sorting
When debugging mtest2make.py changes it is important to be able to compare the old and new output. This requires that any lists in the output have stable sort ordering. Acked-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé committed
Jan 12, 2026 at 14:26 UTC
336213f405b8391ef1346588e9bf6e75ee34f759
1 file changed
+6
-4
scripts/mtest2make.py
+6
-4
@@ -67,8 +67,10 @@ def process_tests(test, targets, suites):
67
suites[s].speeds.add('thorough')
68
69
def emit_prolog(suites, prefix):
70
- all_targets = ' '.join((f'{prefix}-{k}' for k in suites.keys()))
71
- all_xml = ' '.join((f'{prefix}-report-{k}.junit.xml' for k in suites.keys()))
70
+ all_targets = ' '.join((f'{prefix}-{k}'
71
+ for k in sorted(suites.keys())))
72
+ all_xml = ' '.join((f'{prefix}-report-{k}.junit.xml'
73
+ for k in sorted(suites.keys())))
74
print()
75
print(f'all-{prefix}-targets = {all_targets}')
76
print(f'all-{prefix}-xml = {all_xml}')
@@ -81,12 +83,12 @@ def emit_prolog(suites, prefix):
83
print(f'\t$(MAKE) {prefix}$* MTESTARGS="$(MTESTARGS) --logbase {prefix}-report$*" && ln -f meson-logs/$@ .')
84
85
def emit_suite(name, suite, prefix):
84
- deps = ' '.join(suite.deps)
86
+ deps = ' '.join(sorted(suite.deps))
87
print()
88
print(f'.{prefix}-{name}.deps = {deps}')
89
print(f'.ninja-goals.check-build += $(.{prefix}-{name}.deps)')
90
89
- names = ' '.join(suite.names(name))
91
+ names = ' '.join(sorted(suite.names(name)))
92
targets = f'{prefix}-{name} {prefix}-report-{name}.junit.xml'
93
if not name.endswith('-slow') and not name.endswith('-thorough'):
94
targets += f' {prefix} {prefix}-report.junit.xml'