test: print the layout-tester progress bar to stdout by default
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 15 Apr 2021 23:24:20 +0000 (09:24 +1000)
committerRan Benita <ran@unusedvar.com>
Tue, 20 Apr 2021 07:30:17 +0000 (10:30 +0300)
tqdm prints to stderr by default but we're using that for failed keymap
compiles (which are the ones that really matter). Plus, whether we're using tqdm
is dependent on isatty(sys.stdout) anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/xkeyboard-config-test.py.in

index c39b66b..752f027 100755 (executable)
@@ -23,7 +23,7 @@ def escape(s):
 
 # The function generating the progress bar (if any).
 def create_progress_bar(verbose):
-    def noop_progress_bar(x, total):
+    def noop_progress_bar(x, total, file=None):
         return x
 
     progress_bar = noop_progress_bar
@@ -211,7 +211,7 @@ def run(combos, tool, njobs, keymap_output_dir):
     failed = False
     with multiprocessing.Pool(njobs) as p:
         results = p.imap_unordered(tool, combos)
-        for invocation in progress_bar(results, total=len(combos)):
+        for invocation in progress_bar(results, total=len(combos), file=sys.stdout):
             if invocation.exitstatus != 0:
                 failed = True
                 target = sys.stderr