You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/01/17 00:42:42 UTC

svn commit: r1558962 - /subversion/trunk/build/run_tests.py

Author: breser
Date: Thu Jan 16 23:42:41 2014
New Revision: 1558962

URL: http://svn.apache.org/r1558962
Log:
Make some errors when running tests more friendly.

"Don't know what to do about" is not a helpful error.

* build/run_tests.py
  (TestHarness._run_c_test): Specify what we were testing the executable flag,
    prefix the error with a newline so it doesn't run into the test name,
    and simplify the code some.
  (TestHarness._run_py_test): Specify there was an error while loading the
    test, prefix error with newline like above, and print a traceback of
    the exception.

Modified:
    subversion/trunk/build/run_tests.py

Modified: subversion/trunk/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/run_tests.py?rev=1558962&r1=1558961&r2=1558962&view=diff
==============================================================================
--- subversion/trunk/build/run_tests.py (original)
+++ subversion/trunk/build/run_tests.py Thu Jan 16 23:42:41 2014
@@ -46,7 +46,7 @@ separated list of test numbers; the defa
 # A few useful constants
 SVN_VER_MINOR = 9
 
-import os, re, subprocess, sys, imp, threading
+import os, re, subprocess, sys, imp, threading, traceback
 from datetime import datetime
 
 import getopt
@@ -355,16 +355,16 @@ class TestHarness:
     if self.list_tests and self.milestone_filter:
       print 'WARNING: --milestone-filter option does not currently work with C tests'
 
-    if os.access(progbase, os.X_OK):
-      progname = './' + progbase
-      cmdline = [progname,
-                 '--srcdir=' + os.path.join(self.srcdir, progdir)]
-      if self.config_file is not None:
-        cmdline.append('--config-file=' + self.config_file)
-    else:
-      print("Don't know what to do about " + progbase)
+    if not os.access(progbase, os.X_OK):
+      print("\nNot an executable file: " + progbase)
       sys.exit(1)
 
+    progname = './' + progbase
+    cmdline = [progname,
+               '--srcdir=' + os.path.join(self.srcdir, progdir)]
+    if self.config_file is not None:
+      cmdline.append('--config-file=' + self.config_file)
+
     if self.verbose is not None:
       cmdline.append('--verbose')
     if self.cleanup is not None:
@@ -443,7 +443,8 @@ class TestHarness:
       prog_mod = imp.load_module(progbase[:-3], open(prog, 'r'), prog,
                                  ('.py', 'U', imp.PY_SOURCE))
     except:
-      print("Don't know what to do about " + progbase)
+      print("\nError loading test (details in following traceback): " + progbase)
+      traceback.print_exc()
       sys.exit(1)
 
     import svntest.main