Nathan Hartman wrote on Sun, Dec 01, 2019 at 22:22:26 -0500:
> On a related note, I cannot seem to run *just* getopt_tests.py. If I
> run it like this, I get failure:
> 
> [[[
> 
> $ make check TESTS=subversion/tests/cmdline/getopt_tests.py
⋮
> tests.log contains (only the first failure shown, others are similar):

You can consult fails.log too.  Unfortunately, it's created only right before
'make check' exits, so you can't consult it while the tests are still running.

> [[[
> START: getopt_tests.py
> W: CWD: /Users/nate/ramdrive/svn-trunk/subversion/tests/cmdline
> Traceback (most recent call last):
>   File 
> "/Users/nate/ramdrive/svn-trunk/subversion/tests/cmdline/svntest/main.py",
> line 1931, in run
>     rc = self.pred.run(sandbox)
>   File 
> "/Users/nate/ramdrive/svn-trunk/subversion/tests/cmdline/svntest/testcase.py",
> line 178, in run
>     result = self.func(sandbox)
>   File 
> "/Users/nate/ramdrive/svn-trunk/subversion/tests/cmdline/getopt_tests.py",
> line 196, in getopt_no_args
>     run_one_test(sbox, 'svn')
>   File 
> "/Users/nate/ramdrive/svn-trunk/subversion/tests/cmdline/getopt_tests.py",
> line 171, in run_one_test
>     exp_stdout, exp_stderr = load_expected_output(basename)
>   File 
> "/Users/nate/ramdrive/svn-trunk/subversion/tests/cmdline/getopt_tests.py",
> line 57, in load_expected_output
>     exp_stdout = open(stdout_filename, 'r').readlines()
> IOError: [Errno 2] No such file or directory:
> './build/getopt_tests_data/svn_stdout'
> FAIL:  getopt_tests.py 1: run svn with no arguments
> ]]]
> 
> So it's looking for build/getopt_tests_data instead of
> subversion/tests/cmdline/getopt_tests_data. I have not figured out why
> yet.

The attached patch fixes it, but I don't know why.  I came up with it by
comparing the handling of getopt_tests_data to other *_tests_data directories.

> However, if I just run 'make check' and wait patiently,
> getopt_tests.py passes.

Instead of running the entire test suite, you can do «cd …/cmdline &&
./getopt_tests.py».  Run it with --help for details.  You can also do, say,
«./davautocheck.sh getopt» (see comments in the script for more details).

Cheers,

Daniel
Index: subversion/tests/cmdline/getopt_tests.py
===================================================================
--- subversion/tests/cmdline/getopt_tests.py	(revision 1870698)
+++ subversion/tests/cmdline/getopt_tests.py	(working copy)
@@ -38,10 +38,6 @@ import svntest
 
 #----------------------------------------------------------------------
 
-# This directory contains all the expected output from svn.
-getopt_output_dir = os.path.join(os.path.dirname(sys.argv[0]),
-                                 'getopt_tests_data')
-
 # Naming convention for golden files: take the svn command line as a
 # single string and apply the following sed transformations:
 #   echo svn option1 option2 ... | sed -e 's/ /_/g' -e 's/_--/--/g'
@@ -50,6 +46,10 @@ import svntest
 
 def load_expected_output(basename):
   "load the expected standard output and standard error"
+
+  # This directory contains all the expected output from svn.
+  getopt_output_dir = os.path.join(os.path.dirname(sys.argv[0]),
+                                   'getopt_tests_data')
 
   stdout_filename = os.path.join(getopt_output_dir, basename + '_stdout')
   stderr_filename = os.path.join(getopt_output_dir, basename + '_stderr')

Reply via email to