lib-git-svn.sh 870 字节
Newer Older
E
Eric Wong 已提交
1 2 3
. ./test-lib.sh

if test -n "$NO_SVN_TESTS"
4
then
E
Eric Wong 已提交
5 6 7
	test_expect_success 'skipping git-svn tests, NO_SVN_TESTS defined' :
	test_done
	exit
8 9
fi

10 11 12 13
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
SVN_TREE=$GIT_SVN_DIR/svn-tree

14
svn >/dev/null 2>&1
15
if test $? -ne 1
16
then
E
Eric Wong 已提交
17
    test_expect_success 'skipping git-svn tests, svn not found' :
18 19 20 21 22 23
    test_done
    exit
fi

svnrepo=$PWD/svnrepo

24 25 26 27
perl -w -e "
use SVN::Core;
use SVN::Repos;
\$SVN::Core::VERSION gt '1.1.0' or exit(42);
28
system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);
29 30 31
"
x=$?
if test $x -ne 0
32
then
33 34
	if test $x -eq 42; then
		err='Perl SVN libraries must be >= 1.1.0'
35 36
	elif test $x -eq 41; then
		err='svnadmin failed to create fsfs repository'
37 38 39 40 41 42
	else
		err='Perl SVN libraries not found or unusable, skipping test'
	fi
	test_expect_success "$err" :
	test_done
	exit
43 44
fi

45
svnrepo="file://$svnrepo"
46 47