]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Clarify directions when a Python test fails 470/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 21 Jun 2016 16:44:51 +0000 (12:44 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 29 Jun 2016 17:28:27 +0000 (13:28 -0400)
In _onexit() in k5test.py, output an absolute path to the testlog
file, and output explicit directions on re-running the script with the
-v flag.

src/util/k5test.py

index ff86bd9416bde279df835d4e8e912d02d699ad9f..89271fc7649afe42468ade24af54c3316a665013 100644 (file)
@@ -423,7 +423,7 @@ def password(name):
 # Exit handler which ensures processes are cleaned up and, on failure,
 # prints messages to help developers debug the problem.
 def _onexit():
-    global _daemons, _success, verbose
+    global _daemons, _success, srctop, verbose
     global _debug, _stop_before, _stop_after, _shell_before, _shell_after
     if _daemons is None:
         # In Python 2.5, if we exit as a side-effect of importing
@@ -442,7 +442,13 @@ def _onexit():
     if not _success:
         print
         if not verbose:
-            print 'See testlog for details, or re-run with -v flag.'
+            testlogfile = os.path.join(os.getcwd(), 'testlog')
+            utildir = os.path.join(srctop, 'util')
+            print 'For details, see: %s' % testlogfile
+            print 'Or re-run this test script with the -v flag:'
+            print '    cd %s' % os.getcwd()
+            print '    PYTHONPATH=%s %s %s -v' % \
+                (utildir, sys.executable, sys.argv[0])
             print
         print 'Use --debug=NUM to run a command under a debugger.  Use'
         print '--stop-after=NUM to stop after a daemon is started in order to'