git-p4 tests: refactor and cleanup
commitfc002330718c2d939b4a1d0603db1a1ae623aa47
authorPete Wyckoff <pw@padd.com>
Tue, 23 Aug 2011 02:20:33 +0000 (22 22:20 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Oct 2011 03:42:59 +0000 (17 20:42 -0700)
treec0aa27222ec10e87023bcb5d4942b962a8fe2d1e
parent288396994f077eec7e7db0017838a5afbfbf81e3
git-p4 tests: refactor and cleanup

Introduce a library for functions that are common to
multiple git-p4 test files.

Be a bit more clever about starting and stopping p4d.
Specify a unique port number for each test, so that
tests can run in parallel.  Start p4d not in daemon mode,
and save the pid, to be able to kill it cleanly later.
Never kill p4d at startup; always shutdown cleanly.

Handle directory changes better.  Always chdir inside
a subshell, and remove any post-test directory changes.

Clean up whitespace, and use test_cmp and test_must_fail
more consistently.

Separate the tests related to detecting p4 branches
into their own file, and add a few more.

Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-git-p4.sh [new file with mode: 0644]
t/t9800-git-p4.sh
t/t9801-git-p4-branch.sh [new file with mode: 0755]