diff --git a/tests/abandon.sh b/tests/abandon.sh index e59d309e32..93afd62a43 100755 --- a/tests/abandon.sh +++ b/tests/abandon.sh @@ -33,7 +33,7 @@ setup_gitsvn # Verify that "status" doesn't know about it anymore. # The "exit" trickiness is inverting the exit status of grep. test_expect_success "git-cl status dropped abandoned branch" \ - "$GIT_CL status | grep -q abandoned && exit 1 || exit 0" + "$GIT_CL_STATUS | grep -q abandoned && exit 1 || exit 0" ) SUCCESS=$? diff --git a/tests/basic.sh b/tests/basic.sh index edf1cb8d7d..8b7f64b2fc 100755 --- a/tests/basic.sh +++ b/tests/basic.sh @@ -26,7 +26,7 @@ setup_gitsvn git config rietveld.server localhost:8080 test_expect_success "git-cl status has no issue" \ - "$GIT_CL status | grep -q 'no issue'" + "$GIT_CL_STATUS | grep -q 'no issue'" # Prevent the editor from coming up when you upload. export GIT_EDITOR=$(which true) @@ -35,10 +35,10 @@ setup_gitsvn "$GIT_CL upload -m test master | grep -q 'Issue created'" test_expect_success "git-cl status now knows the issue" \ - "$GIT_CL status | grep -q 'Issue number'" + "$GIT_CL_STATUS | grep -q 'Issue number'" # Push a description to this URL. - URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') + URL=$($GIT_CL_STATUS | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') curl --cookie dev_appserver_login="test@example.com:False" \ --data-urlencode subject="test" \ --data-urlencode description="foo-quux" \ @@ -54,7 +54,7 @@ setup_gitsvn "git show | grep -q 'foo-quux'" test_expect_success "issue no longer has a branch" \ - "$GIT_CL status | grep -q 'work: None'" + "$GIT_CL_STATUS | grep -q 'work: None'" test_expect_success "upstream svn has our commit" \ "svn log $REPO_URL 2>/dev/null | grep -q 'foo-quux'" diff --git a/tests/owners.sh b/tests/owners.sh index baa7dd9b0a..70f76a1a95 100755 --- a/tests/owners.sh +++ b/tests/owners.sh @@ -33,7 +33,7 @@ END "$GIT_CL upload -m test master | grep -q 'Issue created'" test_expect_success "git-cl status has a suggested reviewer" \ - "$GIT_CL status | grep -q 'R=ben@chromium.org'" + "$GIT_CL_STATUS | grep -q 'R=ben@chromium.org'" test_expect_failure "git-cl dcommit fails w/ missing LGTM" \ "$GIT_CL dcommit -f" diff --git a/tests/patch.sh b/tests/patch.sh index 6a70b0eeae..038e4d5c8c 100755 --- a/tests/patch.sh +++ b/tests/patch.sh @@ -27,9 +27,9 @@ setup_gitsvn "$GIT_CL upload -m test master | grep -q 'Issue created'" test_expect_success "git-cl status now knows the issue" \ - "$GIT_CL status | grep -q 'Issue number'" + "$GIT_CL_STATUS | grep -q 'Issue number'" - ISSUE=$($GIT_CL status | awk '$0 ~ "Issue number:" { print $3 }') + ISSUE=$($GIT_CL_STATUS | awk '$0 ~ "Issue number:" { print $3 }') git checkout -q -b test2 master diff --git a/tests/push-basic.sh b/tests/push-basic.sh index 1c3c696e63..6b255bcbf9 100755 --- a/tests/push-basic.sh +++ b/tests/push-basic.sh @@ -26,7 +26,7 @@ setup_gitgit git config rietveld.server localhost:8080 test_expect_success "git-cl status has no issue" \ - "$GIT_CL status | grep -q 'no issue'" + "$GIT_CL_STATUS | grep -q 'no issue'" # Prevent the editor from coming up when you upload. export GIT_EDITOR=$(which true) @@ -34,10 +34,10 @@ setup_gitgit "$GIT_CL upload -m test master | grep -q 'Issue created'" test_expect_success "git-cl status now knows the issue" \ - "$GIT_CL status | grep -q 'Issue number'" + "$GIT_CL_STATUS | grep -q 'Issue number'" # Push a description to this URL. - URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') + URL=$($GIT_CL_STATUS | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') curl --cookie dev_appserver_login="test@example.com:False" \ --data-urlencode subject="test" \ --data-urlencode description="foo-quux" \ @@ -45,7 +45,7 @@ setup_gitgit $URL/edit test_expect_success "Base URL contains branch name" \ - "curl -s $($GIT_CL status --field=url) | grep 'URL:' | grep -q '@master'" + "curl -s $($GIT_CL_STATUS --field=url) | grep 'URL:' | grep -q '@master'" test_expect_success "git-cl push ok" \ "$GIT_CL push -f" @@ -57,7 +57,7 @@ setup_gitgit "git show | grep -q 'foo-quux'" test_expect_success "issue no longer has a branch" \ - "$GIT_CL status | grep -q 'work: None'" + "$GIT_CL_STATUS | grep -q 'work: None'" cd $GITREPO_PATH test_expect_success "upstream repo has our commit" \ diff --git a/tests/push-from-logs.sh b/tests/push-from-logs.sh index e68b3d2464..aba4cb242f 100755 --- a/tests/push-from-logs.sh +++ b/tests/push-from-logs.sh @@ -26,7 +26,7 @@ setup_gitgit git config rietveld.server localhost:8080 test_expect_success "git-cl status has no issue" \ - "$GIT_CL status | grep -q 'no issue'" + "$GIT_CL_STATUS | grep -q 'no issue'" # Prevent the editor from coming up when you upload. export EDITOR=$(which true) @@ -35,15 +35,15 @@ setup_gitgit grep -q 'Issue created'" test_expect_success "git-cl status now knows the issue" \ - "$GIT_CL status | grep -q 'Issue number'" + "$GIT_CL_STATUS | grep -q 'Issue number'" # Check to see if the description contains the local commit messages. # Should contain 'branch work' x 2. test_expect_success "git-cl status has the right description for the log" \ - "$GIT_CL status --field desc | [ $( egrep -q '^branch work$' -c ) -eq 2 ] + "$GIT_CL_STATUS --field desc | [ $( egrep -q '^branch work$' -c ) -eq 2 ] test_expect_success "git-cl status has the right subject from message" \ - "$GIT_CL status --field desc | \ + "$GIT_CL_STATUS --field desc | \ [ $( egrep -q '^test$' --byte-offset) | grep '^0:' ] test_expect_success "git-cl push ok" \ @@ -56,7 +56,7 @@ setup_gitgit "git show | [ $( egrep -q '^branch work$' -c ) -eq 2 ] test_expect_success "issue no longer has a branch" \ - "$GIT_CL status | grep -q 'work: None'" + "$GIT_CL_STATUS | grep -q 'work: None'" cd $GITREPO_PATH test_expect_success "upstream repo has our commit" \ diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 4ce05cf820..ad07818043 100755 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -15,7 +15,9 @@ TRUNK_URL=$REPO_URL/trunk BRANCH_URL=$REPO_URL/branches/some_branch GITREPO_PATH=$PWD/gitrepo GITREPO_URL=file://$GITREPO_PATH +PATH="$PWD/..:$PATH" GIT_CL=$PWD/../git-cl +GIT_CL_STATUS="$GIT_CL status -f" # Set up an SVN repo that has a few commits to trunk. setup_initsvn() { diff --git a/tests/upload-stale.sh b/tests/upload-stale.sh index 0ec8b3ef33..6fc8197bfd 100755 --- a/tests/upload-stale.sh +++ b/tests/upload-stale.sh @@ -26,7 +26,7 @@ setup_gitgit "$GIT_CL upload -m test | grep -q 'Issue created'" test_expect_failure "description shouldn't contain unrelated commits" \ - "$GIT_CL status | grep -q 'second commit'" + "$GIT_CL_STATUS | grep -q 'second commit'" ) SUCCESS=$?