MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility
[git/dscho.git] / t / lib-cvs.sh
blobb51d2e13a60352c652db35e812b6949dea4d0f56
1 #!/bin/sh
3 . ./test-lib.sh
5 unset CVS_SERVER
6 # for clean cvsps cache
7 HOME=$(pwd)
8 export HOME
10 if ! type cvs >/dev/null 2>&1
11 then
12 skip_all='skipping cvsimport tests, cvs not found'
13 test_done
16 CVS="cvs -f"
17 export CVS
19 cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
20 case "$cvsps_version" in
21 2.1 | 2.2*)
23 '')
24 skip_all='skipping cvsimport tests, cvsps not found'
25 test_done
28 skip_all='skipping cvsimport tests, unsupported cvsps version'
29 test_done
31 esac
33 setup_cvs_test_repository () {
34 CVSROOT="$(pwd)/.cvsroot" &&
35 cp -r "$TEST_DIRECTORY/$1/cvsroot" "$CVSROOT" &&
36 export CVSROOT
39 test_cvs_co () {
40 # Usage: test_cvs_co BRANCH_NAME
41 rm -rf module-cvs-"$1"
42 if [ "$1" = "master" ]
43 then
44 $CVS co -P -d module-cvs-"$1" -A module
45 else
46 $CVS co -P -d module-cvs-"$1" -r "$1" module
50 test_git_co () {
51 # Usage: test_git_co BRANCH_NAME
52 (cd module-git && git checkout "$1")
55 test_cmp_branch_file () {
56 # Usage: test_cmp_branch_file BRANCH_NAME PATH
57 # The branch must already be checked out of CVS and git.
58 test_cmp module-cvs-"$1"/"$2" module-git/"$2"
61 test_cmp_branch_tree () {
62 # Usage: test_cmp_branch_tree BRANCH_NAME
63 # Check BRANCH_NAME out of CVS and git and make sure that all
64 # of the files and directories are identical.
66 test_cvs_co "$1" &&
67 test_git_co "$1" &&
69 cd module-cvs-"$1"
70 find . -type d -name CVS -prune -o -type f -print
71 ) | sort >module-cvs-"$1".list &&
73 cd module-git
74 find . -type d -name .git -prune -o -type f -print
75 ) | sort >module-git-"$1".list &&
76 test_cmp module-cvs-"$1".list module-git-"$1".list &&
77 cat module-cvs-"$1".list | while read f
79 test_cmp_branch_file "$1" "$f" || return 1
80 done