]> Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/t0001-diff-repo.sh
Include --verify-all test-cases
[svn2svn.git] / tests / t0001-diff-repo.sh
1 #!/bin/bash
2
3 test_description='Test diff-repo.sh
4 '
5 . ./test-lib.sh
6
7 PWD=${TEST_DIRECTORY:-.}
8 PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
9 REPO="$PWD/_repo_tmp"
10 REPO2="$PWD/_repo_tmp2"
11 REPOURL="$PWDURL/_repo_tmp"
12 REPO2URL="$PWDURL/_repo_tmp2"
13 WC="$PWD/_wc_tmp"
14
15 rm -rf "$REPO" "$REPO2" "$WC"
16
17 # Create dummy repo
18 svnadmin create "$REPO"
19 svn mkdir -q -m "Add /trunk" $REPOURL/trunk
20 svn co -q $REPOURL/trunk "$WC"
21 mkdir -p "$WC/Module/ProjectA"
22 echo "Module/ProjectA/FileA1.txt (Initial)" >> "$WC/Module/ProjectA/FileA1.txt"
23 echo "Module/ProjectA/FileA2.txt (Initial)" >> "$WC/Module/ProjectA/FileA2.txt"
24 svn -q add "$WC/Module"
25 svn ci -q -m "Initial population" "$WC"
26
27 test_expect_success \
28 "diff-repo: REPO1/trunk == REPO1/trunk" \
29 "./diff-repo.sh $REPOURL/trunk $REPOURL/trunk"
30
31 test_expect_failure \
32 "diff-repo: REPO1/trunk != REPO1/trunk/Module" \
33 "./diff-repo.sh $REPOURL/trunk $REPOURL/trunk/Module"
34
35 rsync -aq $PWD/_repo_tmp/ $PWD/_repo_tmp2
36
37 test_expect_success \
38 "diff-repo: REPO1/trunk == REPO2/trunk (identical)" \
39 "./diff-repo.sh $REPOURL/trunk $REPO2URL/trunk"
40
41 rm -rf "$WC"
42 svn co -q $REPO2URL/trunk "$WC"
43 echo "Module/ProjectA/FileA1.txt (Edit)" >> "$WC/Module/ProjectA/FileA1.txt"
44 echo "Module/ProjectA/FileA3.txt (New File)" >> "$WC/Module/ProjectA/FileA3.txt"
45 svn -q add "$WC/Module/ProjectA/FileA3.txt"
46 svn ci -q -m "Second commit" "$WC"
47
48 test_expect_failure \
49 "diff-repo: REPO1/trunk != REPO2/trunk (changed)" \
50 "./diff-repo.sh $REPOURL/trunk $REPO2URL/trunk"
51
52 rm -rf "$REPO" "$REPO2" "$WC"
53 test_done