# Run tests
-#SVN2SVN_TEST_OPTS=--verbose --debug
SHELL_PATH ?= $(SHELL)
RM ?= rm -f
+PROVE ?= prove
DEFAULT_TEST_TARGET ?= test
-# Shell quote;
+#SVN2SVN_TEST_OPTS=--verbose --debug
+SVN2SVN_PROVE_OPTS ?= --timer --jobs 10
+
+# Shell quote
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
test: pre-clean $(TEST_LINT)
$(MAKE) aggregate-results-and-cleanup
+prove: pre-clean _repo_ref $(TEST_LINT)
+ @echo "*** prove ***"; $(PROVE) --exec '$(SHELL_PATH_SQ)' $(SVN2SVN_PROVE_OPTS) $(T) :: $(SVN2SVN_TEST_OPTS)
+ $(MAKE) clean
+
$(T): _repo_ref
@echo "*** $@ ***"; '$(SHELL_PATH_SQ)' $@ $(SVN2SVN_TEST_OPTS)
clean:
$(RM) -r test-results
$(RM) -r _wc_*
+ $(RM) -r _repo_t*
test-lint: test-lint-duplicates test-lint-executable
}
PWD=$(pwd)
-WC1="$PWD/_wc_tmp1"
-WC2="$PWD/_wc_tmp2"
+WC1="$PWD/_wc_tmp1_$$"
+WC2="$PWD/_wc_tmp2_$$"
found_diff=0
# Create a working-copy for the reference repo
+++ /dev/null
-#!/bin/bash
-
-test_description='Test diff-repo.sh
-'
-. ./test-lib.sh
-
-PWD=${TEST_DIRECTORY:-.}
-PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
-REPO="$PWD/_repo_tmp"
-REPO2="$PWD/_repo_tmp2"
-REPOURL="$PWDURL/_repo_tmp"
-REPO2URL="$PWDURL/_repo_tmp2"
-WC="$PWD/_wc_tmp"
-
-rm -rf "$REPO" "$REPO2" "$WC"
-
-# Create dummy repo
-svnadmin create "$REPO"
-svn mkdir -q -m "Add /trunk" $REPOURL/trunk
-svn co -q $REPOURL/trunk "$WC"
-mkdir -p "$WC/Module/ProjectA"
-echo "Module/ProjectA/FileA1.txt (Initial)" >> "$WC/Module/ProjectA/FileA1.txt"
-echo "Module/ProjectA/FileA2.txt (Initial)" >> "$WC/Module/ProjectA/FileA2.txt"
-svn -q add "$WC/Module"
-svn ci -q -m "Initial population" "$WC"
-
-test_expect_success \
- "diff-repo: REPO1/trunk == REPO1/trunk" \
- "./diff-repo.sh $REPOURL/trunk $REPOURL/trunk"
-
-test_expect_failure \
- "diff-repo: REPO1/trunk != REPO1/trunk/Module" \
- "./diff-repo.sh $REPOURL/trunk $REPOURL/trunk/Module"
-
-rsync -aq $PWD/_repo_tmp/ $PWD/_repo_tmp2
-
-test_expect_success \
- "diff-repo: REPO1/trunk == REPO2/trunk (identical)" \
- "./diff-repo.sh $REPOURL/trunk $REPO2URL/trunk"
-
-rm -rf "$WC"
-svn co -q $REPO2URL/trunk "$WC"
-echo "Module/ProjectA/FileA1.txt (Edit)" >> "$WC/Module/ProjectA/FileA1.txt"
-echo "Module/ProjectA/FileA3.txt (New File)" >> "$WC/Module/ProjectA/FileA3.txt"
-svn -q add "$WC/Module/ProjectA/FileA3.txt"
-svn ci -q -m "Second commit" "$WC"
-
-test_expect_failure \
- "diff-repo: REPO1/trunk != REPO2/trunk (changed)" \
- "./diff-repo.sh $REPOURL/trunk $REPO2URL/trunk"
-
-rm -rf "$REPO" "$REPO2" "$WC"
-test_done
--- /dev/null
+#!/bin/bash
+
+test_description='Test diff-repo.sh
+'
+. ./test-lib.sh
+
+author='Tony Duckles <tony@nynim.org>'
+
+
+PWD=${TEST_DIRECTORY:-.}
+PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
+REPONAME="_repo_t0100"
+REPO1="$PWD/${REPONAME}_tmp1"
+REPO2="$PWD/${REPONAME}_tmp2"
+REPO1URL="$PWDURL/_repo_t0100_tmp1"
+REPO2URL="$PWDURL/_repo_t0100_tmp2"
+WC="$PWD/_wc_t0100"
+
+test_expect_success \
+ "pre-cleanup" \
+ "rm -rf \"$REPO1\" \"$REPO2\" \"$WC\""
+
+test_expect_success \
+ "create repo1" \
+ "svnadmin create \"$REPO1\""
+
+test_expect_success \
+ "populate repo1" \
+ "svn mkdir -q -m \"Add /trunk\" $REPO1URL/trunk && \
+ svn co -q $REPO1URL/trunk \"$WC\" && \
+ mkdir -p \"$WC/Module/ProjectA\" && \
+ echo \"Module/ProjectA/FileA1.txt (Initial)\" >> \"$WC/Module/ProjectA/FileA1.txt\" && echo \"Module/ProjectA/FileA2.txt (Initial)\" >> \"$WC/Module/ProjectA/FileA2.txt\" && \
+ svn -q add \"$WC/Module\" && \
+ svn ci -q -m \"Initial population\" \"$WC\""
+
+test_expect_success \
+ "diff-repo: repo1/trunk == repo1/trunk" \
+ "./diff-repo.sh $REPO1URL/trunk $REPO1URL/trunk"
+
+test_expect_failure \
+ "diff-repo: repo1/trunk != repo1/trunk/Module" \
+ "./diff-repo.sh $REPO1URL/trunk $REPO1URL/trunk/Module"
+
+test_expect_success \
+ "rsync repo1 -> repo2" \
+ "rsync -aq \"$REPO1/\" \"$REPO2\""
+
+test_expect_success \
+ "diff-repo: repo1/trunk == repo2/trunk (identical)" \
+ "./diff-repo.sh $REPO1URL/trunk $REPO2URL/trunk"
+
+test_expect_success \
+ "modify repo2 content" \
+ "rm -rf \"$WC\" && \
+ svn co -q $REPO2URL/trunk \"$WC\" && \
+ echo \"Module/ProjectA/FileA1.txt (Edit)\" >> \"$WC/Module/ProjectA/FileA1.txt\" && \
+ echo \"Module/ProjectA/FileA3.txt (New File)\" >> \"$WC/Module/ProjectA/FileA3.txt\" && \
+ svn -q add \"$WC/Module/ProjectA/FileA3.txt\" && \
+ svn ci -q -m \"Second commit\" \"$WC\""
+
+test_expect_failure \
+ "diff-repo: repo1/trunk != repo2/trunk (changed)" \
+ "./diff-repo.sh $REPO1URL/trunk $REPO2URL/trunk"
+
+test_expect_success \
+ "cleanup" \
+ "rm -rf \"$REPO1\" \"$REPO2\" \"$WC\""
+
+test_done
+++ /dev/null
-#!/bin/bash
-
-test_description='Use svnreplay to create a full copy of the ref repo
-'
-. ./test-lib.sh
-. ./replay-lib.sh
-
-SVNREPLAY="../svnreplay.py"
-PWD=${TEST_DIRECTORY:-.}
-PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
-REPO="$PWD/_repo_replay"
-REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
-
-init_replay_repo "$REPO"
-rm -rf _wc_target
-
-################################################################
-OFFSET="/"
-
-test_expect_success \
- "svnreplay _repo_ref$OFFSET _repo_replay$OFFSET" \
- "$SVNREPLAY -av \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_success \
- "svnreplay _repo_ref$OFFSET _repo_replay$OFFSET (verify-all)" \
- "$SVNREPLAY -avcX \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_success \
- "diff-repo _repo_ref$OFFSET _repo_replay$OFFSET" \
- "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-rm -rf "$REPO" _wc_target
-test_done
+++ /dev/null
-#!/bin/bash
-
-test_description='Use svnreplay to create a filtered repo with only /trunk history
-'
-. ./test-lib.sh
-. ./replay-lib.sh
-
-SVNREPLAY="../svnreplay.py"
-PWD=${TEST_DIRECTORY:-.}
-PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
-REPO="$PWD/_repo_replay"
-REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
-
-init_replay_repo "$REPO"
-rm -rf _wc_target
-
-################################################################
-OFFSET="/trunk"
-svn mkdir -q -m "Add $OFFSET" $REPOURL$OFFSET
-
-test_expect_success \
- "svnreplay _repo_ref$OFFSET _repo_replay$OFFSET" \
- "$SVNREPLAY -av \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_success \
- "svnreplay _repo_ref$OFFSET _repo_replay$OFFSET (verify-all)" \
- "$SVNREPLAY -avcX \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_success \
- "diff-repo _repo_ref$OFFSET _repo_replay$OFFSET" \
- "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-rm -rf "$REPO" _wc_target
-test_done
+++ /dev/null
-#!/bin/bash
-
-test_description='Use svnreplay to create a filtered repo with only /trunk/Module2/ProjectB history
-'
-. ./test-lib.sh
-. ./replay-lib.sh
-
-SVNREPLAY="../svnreplay.py"
-PWD=${TEST_DIRECTORY:-.}
-PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
-REPO="$PWD/_repo_replay"
-REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
-
-init_replay_repo "$REPO"
-rm -rf _wc_target
-
-################################################################
-OFFSET="/trunk/Module2/ProjectB"
-svn mkdir -q -m "Add /trunk" $REPOURL/trunk
-svn mkdir -q --parents -m "Add $OFFSET" $REPOURL$OFFSET
-
-test_expect_success \
- "svnreplay _repo_ref$OFFSET _repo_replay$OFFSET" \
- "$SVNREPLAY -av \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_success \
- "svnreplay _repo_ref$OFFSET _repo_replay$OFFSET (verify-all)" \
- "$SVNREPLAY -avcX \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_success \
- "diff-repo _repo_ref$OFFSET _repo_replay$OFFSET" \
- "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-rm -rf "$REPO" _wc_target
-test_done
+++ /dev/null
-#!/bin/bash
-
-test_description='Use svnreplay along with --pre-commit to create a modified filtered repo with only /trunk/Module2/ProjectB history
-'
-. ./test-lib.sh
-. ./replay-lib.sh
-
-SVNREPLAY="../svnreplay.py"
-PWD=${TEST_DIRECTORY:-.}
-PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
-REPO="$PWD/_repo_replay"
-REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
-
-init_replay_repo "$REPO"
-rm -rf _wc_target
-
-################################################################
-OFFSET="/trunk/Module2/ProjectB"
-svn mkdir -q -m "Add /trunk" $REPOURL/trunk
-svn mkdir -q --parents -m "Add $OFFSET" $REPOURL$OFFSET
-
-test_expect_success \
- "svnreplay --pre-commit _repo_ref$OFFSET _repo_replay$OFFSET" \
- "$SVNREPLAY -av --pre-commit=\"$PWD/t0103/before-commit.sh\" \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_failure \
- "svnreplay --pre-commit _repo_ref$OFFSET _repo_replay$OFFSET (verify-all)" \
- "$SVNREPLAY -avcX --pre-commit=\"$PWD/t0103/before-commit.sh\" \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-test_expect_failure \
- "diff-repo _repo_ref$OFFSET _repo_replay$OFFSET" \
- "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$PWDURL/_repo_replay$OFFSET\""
-
-#rm -rf "$REPO" _wc_target
-test_done
--- /dev/null
+#!/bin/bash
+
+test_description='Use svnreplay to create a full copy of the ref repo
+'
+. ./test-lib.sh
+. ./replay-lib.sh
+
+author='Tony Duckles <tony@nynim.org>'
+
+
+SVNREPLAY="../svnreplay.py"
+PWD=${TEST_DIRECTORY:-.}
+PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
+REPONAME="_repo_t1100"
+REPO="$PWD/$REPONAME"
+REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
+WC="$PWD/_wc_t1100"
+OFFSET="/"
+
+test_expect_success \
+ "pre-cleanup" \
+ "rm -rf \"$WC\""
+
+test_expect_success \
+ "init repo $REPONAME" \
+ "init_replay_repo \"$REPO\""
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "$SVNREPLAY -av --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET (verify-all)" \
+ "$SVNREPLAY -avcX --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "diff-repo _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "cleanup $REPONAME" \
+ "rm -rf \"$REPO\" \"$WC\""
+
+test_done
--- /dev/null
+#!/bin/bash
+
+test_description='Use svnreplay to create a filtered repo with only /trunk history
+'
+. ./test-lib.sh
+. ./replay-lib.sh
+
+author='Tony Duckles <tony@nynim.org>'
+
+
+SVNREPLAY="../svnreplay.py"
+PWD=${TEST_DIRECTORY:-.}
+PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
+REPONAME="_repo_t1101"
+REPO="$PWD/$REPONAME"
+REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
+WC="$PWD/_wc_t1101"
+OFFSET="/trunk"
+
+test_expect_success \
+ "pre-cleanup" \
+ "rm -rf \"$WC\""
+
+test_expect_success \
+ "init repo $REPONAME" \
+ "init_replay_repo \"$REPO\""
+
+test_expect_success \
+ "svn mkdir $REPONAME$OFFSET" \
+ "svn mkdir -q -m \"Add $OFFSET\" $REPOURL$OFFSET"
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "$SVNREPLAY -av --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET (verify-all)" \
+ "$SVNREPLAY -avcX --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "diff-repo _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "cleanup $REPONAME" \
+ "rm -rf \"$REPO\" \"$WC\""
+
+test_done
--- /dev/null
+#!/bin/bash
+
+test_description='Use svnreplay to create a filtered repo with only /trunk/Module2/ProjectB history
+'
+. ./test-lib.sh
+. ./replay-lib.sh
+
+author='Tony Duckles <tony@nynim.org>'
+
+
+SVNREPLAY="../svnreplay.py"
+PWD=${TEST_DIRECTORY:-.}
+PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
+REPONAME="_repo_t1102"
+REPO="$PWD/$REPONAME"
+REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
+WC="$PWD/_wc_t1102"
+
+OFFSET="/trunk/Module2/ProjectB"
+
+test_expect_success \
+ "pre-cleanup" \
+ "rm -rf \"$WC\""
+
+test_expect_success \
+ "init repo $REPONAME" \
+ "init_replay_repo \"$REPO\""
+
+test_expect_success \
+ "svn mkdir $REPONAME/trunk" \
+ "svn mkdir -q -m \"Add /trunk\" $REPOURL/trunk"
+test_expect_success \
+ "svn mkdir $REPONAME$OFFSET" \
+ "svn mkdir -q --parents -m \"Add $OFFSET\" $REPOURL$OFFSET"
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "$SVNREPLAY -av --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET (verify-all)" \
+ "$SVNREPLAY -avcX --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "diff-repo _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "cleanup $REPONAME" \
+ "rm -rf \"$REPO\" \"$WC\""
+
+test_done
--- /dev/null
+#!/bin/bash
+
+test_description='Use svnreplay along with --pre-commit to create a modified filtered repo with only /trunk/Module2/ProjectB history
+'
+. ./test-lib.sh
+. ./replay-lib.sh
+
+author='Tony Duckles <tony@nynim.org>'
+
+
+SVNREPLAY="../svnreplay.py"
+PWD=${TEST_DIRECTORY:-.}
+PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
+REPONAME="_repo_t1200"
+REPO="$PWD/$REPONAME"
+REPOURL=$(echo "file://$REPO" | sed 's/\ /%20/g')
+WC="$PWD/_wc_t1200"
+OFFSET="/trunk/Module2/ProjectB"
+
+test_expect_success \
+ "pre-cleanup" \
+ "rm -rf \"$WC\""
+
+test_expect_success \
+ "init repo $REPONAME" \
+ "init_replay_repo \"$REPO\""
+
+test_expect_success \
+ "svn mkdir $REPONAME/trunk" \
+ "svn mkdir -q -m \"Add /trunk\" $REPOURL/trunk"
+test_expect_success \
+ "svn mkdir $REPONAME$OFFSET" \
+ "svn mkdir -q --parents -m \"Add $OFFSET\" $REPOURL$OFFSET"
+
+test_expect_success \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "$SVNREPLAY -av --pre-commit=\"$PWD/t1200/before-commit.sh\" --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_failure \
+ "svnreplay _repo_ref$OFFSET $REPONAME$OFFSET (verify-all)" \
+ "$SVNREPLAY -avcX --pre-commit=\"$PWD/t1200/before-commit.sh\" --wc \"$WC\" \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_failure \
+ "diff-repo _repo_ref$OFFSET $REPONAME$OFFSET" \
+ "./diff-repo.sh \"$PWDURL/_repo_ref$OFFSET\" \"$REPOURL$OFFSET\""
+
+test_expect_success \
+ "cleanup $REPONAME" \
+ "rm -rf \"$REPO\" \"$WC\""
+
+test_done