On Sun, Dec 1, 2019 at 10:50 PM Daniel Shahaf <[email protected]> wrote:
> 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:
(snip)
> > $ make check TESTS=subversion/tests/cmdline/getopt_tests.py
(snip)
> > However, if I just run 'make check' and wait patiently,
> > getopt_tests.py passes.
> 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.
You're right. Your patch does fix it. (At least for the use case I
mentioned previously -- 'make check TESTS=...')
Your patch moves the following into load_expected_output():
# This directory contains all the expected output from svn.
getopt_output_dir = os.path.join(os.path.dirname(sys.argv[0]),
'getopt_tests_data')
I haven't confirmed this yet but I think that fixes it because at some
point between initialization and this test running, sys.argv[0] is
being modified. I found two instances of sys.argv[0] being assigned in
subversion/tests/cmdline/svntest/main.py -- see _internal_run_tests()
and execute_tests(). Not sure if that's where it's happening.
But I have confirmed that after applying this patch I can successfully
run:
$ make check TESTS=subversion/tests/cmdline/getopt_tests.py
I'm running the full test suite now...
If all goes well then I think it should be committed.
Nathan