From 8b54efe12900af1f0a43da92e183a10cd6346fb8 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 13 Oct 2012 09:53:01 -0700 Subject: [PATCH] Clean-up unit-tests * Move to a stricter unit-test naming convention: * t1xxx-*.sh are the svnreplay tests. * t2xxx-*.sh are the svnancest tests. * Support multi-jobbing unit-tests. Make all the unit-tests multi-job safe, e.g. use unique repo's and wc's for each test. * Ensure all test logic is run via assert's. * Introduce "prove" Makefile target for unit-tests, to allow running all the tests multi-jobbed via prove. --- tests/Makefile | 12 ++++- tests/diff-repo.sh | 4 +- tests/replay-lib.sh | 0 tests/t0001-diff-repo.sh | 53 ------------------- tests/t0100-diff-repo.sh | 69 +++++++++++++++++++++++++ tests/t0100-replay-all.sh | 33 ------------ tests/t0101-replay-trunk.sh | 34 ------------ tests/t0102-replay-branch.sh | 35 ------------- tests/t0103-replay-beforecommit.sh | 35 ------------- tests/t1100-replay-all.sh | 44 ++++++++++++++++ tests/t1101-replay-trunk.sh | 48 +++++++++++++++++ tests/t1102-replay-branch.sh | 52 +++++++++++++++++++ tests/t1200-replay-beforecommit.sh | 51 ++++++++++++++++++ tests/{t0103 => t1200}/before-commit.sh | 0 tests/test-lib-functions.sh | 0 tests/test-lib.sh | 0 16 files changed, 276 insertions(+), 194 deletions(-) mode change 100755 => 100644 tests/replay-lib.sh delete mode 100755 tests/t0001-diff-repo.sh create mode 100755 tests/t0100-diff-repo.sh delete mode 100755 tests/t0100-replay-all.sh delete mode 100755 tests/t0101-replay-trunk.sh delete mode 100755 tests/t0102-replay-branch.sh delete mode 100755 tests/t0103-replay-beforecommit.sh create mode 100755 tests/t1100-replay-all.sh create mode 100755 tests/t1101-replay-trunk.sh create mode 100755 tests/t1102-replay-branch.sh create mode 100755 tests/t1200-replay-beforecommit.sh rename tests/{t0103 => t1200}/before-commit.sh (100%) mode change 100755 => 100644 tests/test-lib-functions.sh mode change 100755 => 100644 tests/test-lib.sh diff --git a/tests/Makefile b/tests/Makefile index eb7deb4..4259b64 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,11 +1,14 @@ # 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)) @@ -15,6 +18,10 @@ all: $(DEFAULT_TEST_TARGET) 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) @@ -27,6 +34,7 @@ pre-clean: clean: $(RM) -r test-results $(RM) -r _wc_* + $(RM) -r _repo_t* test-lint: test-lint-duplicates test-lint-executable diff --git a/tests/diff-repo.sh b/tests/diff-repo.sh index 75d9e47..1728275 100755 --- a/tests/diff-repo.sh +++ b/tests/diff-repo.sh @@ -7,8 +7,8 @@ } 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 diff --git a/tests/replay-lib.sh b/tests/replay-lib.sh old mode 100755 new mode 100644 diff --git a/tests/t0001-diff-repo.sh b/tests/t0001-diff-repo.sh deleted file mode 100755 index 14d4132..0000000 --- a/tests/t0001-diff-repo.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 diff --git a/tests/t0100-diff-repo.sh b/tests/t0100-diff-repo.sh new file mode 100755 index 0000000..d10639c --- /dev/null +++ b/tests/t0100-diff-repo.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +test_description='Test diff-repo.sh +' +. ./test-lib.sh + +author='Tony Duckles ' + + +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 diff --git a/tests/t0100-replay-all.sh b/tests/t0100-replay-all.sh deleted file mode 100755 index 8942a0f..0000000 --- a/tests/t0100-replay-all.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/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 diff --git a/tests/t0101-replay-trunk.sh b/tests/t0101-replay-trunk.sh deleted file mode 100755 index 49e6da3..0000000 --- a/tests/t0101-replay-trunk.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/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 diff --git a/tests/t0102-replay-branch.sh b/tests/t0102-replay-branch.sh deleted file mode 100755 index ed73b28..0000000 --- a/tests/t0102-replay-branch.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 diff --git a/tests/t0103-replay-beforecommit.sh b/tests/t0103-replay-beforecommit.sh deleted file mode 100755 index d5c6ce6..0000000 --- a/tests/t0103-replay-beforecommit.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 diff --git a/tests/t1100-replay-all.sh b/tests/t1100-replay-all.sh new file mode 100755 index 0000000..da325a4 --- /dev/null +++ b/tests/t1100-replay-all.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +test_description='Use svnreplay to create a full copy of the ref repo +' +. ./test-lib.sh +. ./replay-lib.sh + +author='Tony Duckles ' + + +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 diff --git a/tests/t1101-replay-trunk.sh b/tests/t1101-replay-trunk.sh new file mode 100755 index 0000000..ca61995 --- /dev/null +++ b/tests/t1101-replay-trunk.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +test_description='Use svnreplay to create a filtered repo with only /trunk history +' +. ./test-lib.sh +. ./replay-lib.sh + +author='Tony Duckles ' + + +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 diff --git a/tests/t1102-replay-branch.sh b/tests/t1102-replay-branch.sh new file mode 100755 index 0000000..c149b16 --- /dev/null +++ b/tests/t1102-replay-branch.sh @@ -0,0 +1,52 @@ +#!/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 ' + + +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 diff --git a/tests/t1200-replay-beforecommit.sh b/tests/t1200-replay-beforecommit.sh new file mode 100755 index 0000000..72bbb94 --- /dev/null +++ b/tests/t1200-replay-beforecommit.sh @@ -0,0 +1,51 @@ +#!/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 ' + + +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 diff --git a/tests/t0103/before-commit.sh b/tests/t1200/before-commit.sh similarity index 100% rename from tests/t0103/before-commit.sh rename to tests/t1200/before-commit.sh diff --git a/tests/test-lib-functions.sh b/tests/test-lib-functions.sh old mode 100755 new mode 100644 diff --git a/tests/test-lib.sh b/tests/test-lib.sh old mode 100755 new mode 100644 -- 2.45.2