[nasm:macho-unify] travis: nasm-t.py -- Show compilation errors in output

nasm-bot for Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 30 17:02:56 PDT 2020


Commit-ID:  9f4ca1d8819c7d526a7dc7ce31d92d318737f477
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=9f4ca1d8819c7d526a7dc7ce31d92d318737f477
Author:     Cyrill Gorcunov <gorcunov at gmail.com>
AuthorDate: Sat, 5 May 2018 12:16:44 +0300
Committer:  Cyrill Gorcunov <gorcunov at gmail.com>
CommitDate: Wed, 9 May 2018 18:03:50 +0300

travis: nasm-t.py -- Show compilation errors in output

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>


---
 travis/nasm-t.py | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/travis/nasm-t.py b/travis/nasm-t.py
index 5b4acb6f..714eccca 100755
--- a/travis/nasm-t.py
+++ b/travis/nasm-t.py
@@ -283,24 +283,29 @@ def exec_nasm(desc):
         test_fail(desc['_test-name'], "Unable to execute test")
         return None
     wait_rc = pnasm.wait();
+
+    stdout = pnasm.stdout.read().decode("utf-8").strip("\n")
+    stderr = pnasm.stderr.read().decode("utf-8").strip("\n")
+    pnasm.stdout.close()
+    pnasm.stderr.close()
+
     if desc['_wait'] != wait_rc:
+        if stdout != "":
+            show_std("stdout", stdout)
+        if stderr != "":
+            show_std("stderr", stderr)
         test_fail(desc['_test-name'],
                   "Unexpected ret code: " + str(wait_rc))
-        return None
-    return pnasm
+        return None, None, None
+    return pnasm, stdout, stderr
 
 def test_run(desc):
     print("=== Running %s ===" % (desc['_test-name']))
 
-    pnasm = exec_nasm(desc)
+    pnasm, stdout, stderr = exec_nasm(desc)
     if pnasm == None:
         return False
 
-    stdout = pnasm.stdout.read().decode("utf-8").strip("\n")
-    stderr = pnasm.stderr.read().decode("utf-8").strip("\n")
-    pnasm.stdout.close()
-    pnasm.stderr.close()
-
     for t in desc['target']:
         if 'output' in t:
             output = desc['_base-dir'] + os.sep + t['output']


More information about the Nasm-commits mailing list