Test harness errors are printed to tests.log

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Test harness errors are printed to tests.log

Daniel Shahaf-2
I tried to run «make check TESTS=/path/to/build/tree/.../basic_tests.py»
in an out-of-tree build and got the following error:

    [1/1] basic_tests.pyMakefile:530: recipe for target 'check' failed

This error is rather opaque.  It turns out that the actual error message
was written to tests.log because run_tests.py uses dup2().  We should
change it as follows:

Index: build/run_tests.py
--- build/run_tests.py (revision 1813813)
+++ build/run_tests.py (working copy)
@@ -829,6 +829,7 @@
       old_stdout = os.dup(sys.stdout.fileno())
       old_stderr = os.dup(sys.stderr.fileno())
+      # These two lines...
       os.dup2(self.log.fileno(), sys.stdout.fileno())
       os.dup2(self.log.fileno(), sys.stderr.fileno())
Index: subversion/tests/cmdline/svntest/main.py
--- subversion/tests/cmdline/svntest/main.py (revision 1813803)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -2023,6 +2023,8 @@
   global logger
+  # ... should create a logging configuration to be used by this:
   # Initialize the LOGGER global variable so the option parsing can set
   # its loglevel, as appropriate.
   logger = logging.getLogger()