OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Abort on error. |
| 4 set -e |
| 5 |
| 6 PWD=`pwd` |
| 7 REPO_URL=file://$PWD/svnrepo |
| 8 GIT_CL=$PWD/../git-cl |
| 9 |
| 10 # Set up an SVN repo that has a few commits to trunk. |
| 11 setup_initsvn() { |
| 12 echo "Setting up test SVN repo..." |
| 13 rm -rf svnrepo |
| 14 svnadmin create svnrepo |
| 15 |
| 16 rm -rf svn |
| 17 svn co -q $REPO_URL svn |
| 18 ( |
| 19 cd svn |
| 20 echo "test" > test |
| 21 svn add -q test |
| 22 svn commit -q -m "initial commit" |
| 23 echo "test2" >> test |
| 24 svn commit -q -m "second commit" |
| 25 ) |
| 26 } |
| 27 |
| 28 # Set up a git-svn checkout of the repo. |
| 29 setup_gitsvn() { |
| 30 echo "Setting up test git-svn repo..." |
| 31 rm -rf git-svn |
| 32 # There appears to be no way to make git-svn completely shut up, so we |
| 33 # redirect its output. |
| 34 git svn -q clone $REPO_URL git-svn >/dev/null 2>&1 |
| 35 } |
| 36 |
| 37 cleanup() { |
| 38 rm -rf svnrepo svn git-svn |
| 39 } |
| 40 |
| 41 # Usage: test_expect_success "description of test" "test code". |
| 42 test_expect_success() { |
| 43 echo "TESTING: $1" |
| 44 exit_code=0 |
| 45 sh -c "$2" || exit_code=$? |
| 46 if [ $exit_code != 0 ]; then |
| 47 echo "FAILURE: $1" |
| 48 return $exit_code |
| 49 fi |
| 50 } |
OLD | NEW |