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

Unified Diff: depot_tools/tests/test-lib.sh

Issue 92087: Create the Next Generation of depot_tools. Eh. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/tools/
Patch Set: Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « depot_tools/tests/presubmit_unittest.py ('k') | depot_tools/trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: depot_tools/tests/test-lib.sh
===================================================================
--- depot_tools/tests/test-lib.sh (revision 0)
+++ depot_tools/tests/test-lib.sh (revision 0)
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Abort on error.
+set -e
+
+PWD=`pwd`
+REPO_URL=file://$PWD/svnrepo
+GIT_CL=$PWD/../git-cl
+
+# Set up an SVN repo that has a few commits to trunk.
+setup_initsvn() {
+ echo "Setting up test SVN repo..."
+ rm -rf svnrepo
+ svnadmin create svnrepo
+
+ rm -rf svn
+ svn co -q $REPO_URL svn
+ (
+ cd svn
+ echo "test" > test
+ svn add -q test
+ svn commit -q -m "initial commit"
+ echo "test2" >> test
+ svn commit -q -m "second commit"
+ )
+}
+
+# Set up a git-svn checkout of the repo.
+setup_gitsvn() {
+ echo "Setting up test git-svn repo..."
+ rm -rf git-svn
+ # There appears to be no way to make git-svn completely shut up, so we
+ # redirect its output.
+ git svn -q clone $REPO_URL git-svn >/dev/null 2>&1
+}
+
+cleanup() {
+ rm -rf svnrepo svn git-svn
+}
+
+# Usage: test_expect_success "description of test" "test code".
+test_expect_success() {
+ echo "TESTING: $1"
+ exit_code=0
+ sh -c "$2" || exit_code=$?
+ if [ $exit_code != 0 ]; then
+ echo "FAILURE: $1"
+ return $exit_code
+ fi
+}
Property changes on: depot_tools\tests\test-lib.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
« no previous file with comments | « depot_tools/tests/presubmit_unittest.py ('k') | depot_tools/trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698