print error message when test.py list printing fails
authorTom Henderson <tomh@tomh.org>
Mon, 30 Jun 2014 11:09:35 -0700
changeset 10828 eca3cb80bc79
parent 10827 d8fb41070290
child 10833 efb71dd034e0
print error message when test.py list printing fails
test.py
--- a/test.py	Sun Jun 29 20:19:00 2014 -0700
+++ b/test.py	Mon Jun 30 11:09:35 2014 -0700
@@ -1162,6 +1162,11 @@
         else:
             path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --print-test-types")
         (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
+        if rc != 0:
+            # This is usually a sign that ns-3 crashed or exited uncleanly
+            print('test.py error:  test-runner return code returned {}'.format(rc))
+            print('To debug, try running {}\n'.format('\'./waf --run \"test-runner --print-test-name-list\"\''))
+            return
         list_items = standard_out.split('\n')
         list_items.sort()
         print "Test Type    Test Name"