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

Side by Side Diff: git_cl/test/hooks.sh

Issue 6679033: fix git-cl test scripts (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « git_cl/test/basic.sh ('k') | git_cl/test/owners.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Tests the "preupload and predcommit hooks" functionality, which lets you run 3 # Tests the "preupload and predcommit hooks" functionality, which lets you run
4 # hooks by installing a script into .git/hooks/pre-cl-* first. 4 # hooks by installing a script into .git/hooks/pre-cl-* first.
5 5
6 set -e 6 set -e
7 7
8 . ./test-lib.sh 8 . ./test-lib.sh
9 9
10 setup_initsvn 10 setup_initsvn
11 setup_gitsvn 11 setup_gitsvn
12 12
13 setup_hooks() { 13 setup_hooks() {
14 upload_retval = shift 14 upload_retval=$1
15 dcommit_retval = shift 15 dcommit_retval=$2
16 16
17 echo > PRESUBMIT.py <<END 17 echo > PRESUBMIT.py <<END
18 def CheckChangeOnUpload(input_api, output_api): 18 def CheckChangeOnUpload(input_api, output_api):
19 return $upload_retval 19 return $upload_retval
20 20
21 def CheckChangeOnCommit(input_api, output_api): 21 def CheckChangeOnCommit(input_api, output_api):
22 return $dcommit_retval 22 return $dcommit_retval
23 END 23 END
24 } 24 }
25 25
(...skipping 15 matching lines...) Expand all
41 # Verify git cl dcommit fails. 41 # Verify git cl dcommit fails.
42 test_expect_failure "git-cl dcommit hook fails" "$GIT_CL dcommit master" 42 test_expect_failure "git-cl dcommit hook fails" "$GIT_CL dcommit master"
43 ) 43 )
44 SUCCESS=$? 44 SUCCESS=$?
45 45
46 #cleanup 46 #cleanup
47 47
48 if [ $SUCCESS == 0 ]; then 48 if [ $SUCCESS == 0 ]; then
49 echo PASS 49 echo PASS
50 fi 50 fi
OLDNEW
« no previous file with comments | « git_cl/test/basic.sh ('k') | git_cl/test/owners.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698