Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: tests/test-lib.sh

Issue 122040: Refactor the unit tests. (Closed)
Patch Set: even more cleanup Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/revert_unittest.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « tests/revert_unittest.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698