[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Issue tracker housecleaning: SVN-1722

From: Nathan Hartman <hartman.nathan_at_gmail.com>
Date: Thu, 17 Oct 2019 11:22:59 -0400

Test below. Please review...

On Thu, Oct 17, 2019 at 8:18 AM Branko Čibej <brane_at_apache.org> wrote:
> >> Is it possible, through some incantation that I've overlooked, to run
> >> the cmdline tests against an arbitrary svn binary?
> make check SVN_BIN_DIR=/opt/foo/some/path
>
> See Makefile.in, line 617.

Btw, apparently, 1.8.19 is far too old to run with the current test suite.

When I attempted:
    make check TESTS=subversion/tests/cmdline/diff_tests.py \
               SVN_BIN_DIR=(path to 1.8.19 bin dir here)

I got this:
[1/1] diff_tests.py......................................................FAILURE
Summary of test results:
SUMMARY: Some tests failed.

(It says 1/1 because I commented out everything except my test in test_list.)

It doesn't print details of what failed and tests.log contains only this:
START: diff_tests.py
END: diff_tests.py
ELAPSED: diff_tests.py 0:00:00.015756

There is no fails.log, no traceback, nothing.

So I tried copying my test over to a working copy of 1.8.19. That doesn't
work because too much of the test harness has changed since then.
Oh well. Not worth the effort. All I wanted was to prove that the test
will fail on a version known to have the bug, but given how pedantic
run_and_verify_svn was about my expected output EXACTLY matching
(it took some head scratching to figure out that I was missing a newline),
I'm 100% sure this would definitely fail on 1.8.19.

Anyway this passes on svn trunk as of r1868559.

This being my first test, if someone could just glance and see if I've
made some obvious faux pas, I'd appreciate that...

[[[

#----------------------------------------------------------------------
# Regression test for issue #1722: 'svn diff' produced a wrong header,
# indicating one revision as being in the working copy when it should
# be 'nonexistent'
@Issue(1722)
def diff_nonexistent_in_wc(sbox):
  "nonexistent in working copy"

  sbox.build(empty=True)
  wc_dir = sbox.wc_dir

  # We mirror the actions of the reproduction script (with one exception:
  # we 'svn up -r 0' instead of checking out a second working copy)

  sbox.simple_add_text('test\n', 'file')
  sbox.simple_commit()
  sbox.simple_update(revision=0)

  # Expected output is empty for these cases:
  # svn diff -r BASE
  # svn diff -r 0:BASE
  # svn diff -r 0

  # Expected output for:
  # svn diff -r BASE:HEAD
  # svn diff -r 0:HEAD
  # svn diff -r 0:1
  expected_output_base_head = make_diff_header("file", "nonexistent",
                                               "revision 1") + [
  "@@ -0,0 +1 @@\n",
  "+test\n",
  ]

  # Expected output for:
  # svn diff -r HEAD:BASE
  # svn diff -r HEAD
  # svn diff -r 1:0
  # svn diff -r 1
  expected_output_head_base = make_diff_header("file", "revision 1",
                                               "nonexistent") + [
  "@@ -1 +0,0 @@\n",
  "-test\n"
  ]

  os.chdir(wc_dir)

  svntest.actions.run_and_verify_svn(expected_output_base_head, [],
                                     'diff', '-r', 'BASE:HEAD')

  svntest.actions.run_and_verify_svn(expected_output_head_base, [],
                                     'diff', '-r', 'HEAD:BASE')

  svntest.actions.run_and_verify_svn([], [],
                                     'diff', '-r', 'BASE')

  svntest.actions.run_and_verify_svn(expected_output_head_base, [],
                                     'diff', '-r', 'HEAD')

  svntest.actions.run_and_verify_svn([], [],
                                     'diff', '-r', '0:BASE')

  svntest.actions.run_and_verify_svn(expected_output_base_head, [],
                                     'diff', '-r', '0:HEAD')

  svntest.actions.run_and_verify_svn(expected_output_base_head, [],
                                     'diff', '-r', '0:1')

  svntest.actions.run_and_verify_svn(expected_output_head_base, [],
                                     'diff', '-r', '1:0')

  svntest.actions.run_and_verify_svn([], [],
                                     'diff', '-r', '0')

  svntest.actions.run_and_verify_svn(expected_output_head_base, [],
                                     'diff', '-r', '1')

]]]

Thanks,
Nathan
Received on 2019-10-17 17:23:17 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.