From: Greg Hudson Date: Tue, 21 Jun 2016 16:44:51 +0000 (-0400) Subject: Clarify directions when a Python test fails X-Git-Tag: krb5-1.15-beta1~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b7fd9b61b442ba0d5dbd915e83685b366a4545;p=thirdparty%2Fkrb5.git Clarify directions when a Python test fails 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. --- diff --git a/src/util/k5test.py b/src/util/k5test.py index ff86bd9416..89271fc764 100644 --- a/src/util/k5test.py +++ b/src/util/k5test.py @@ -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'