From: Phil Hord <hordp@cisco.com>
To: git@vger.kernel.org
Cc: phil.hord@gmail.com, Jeff King <peff@peff.net>,
Junio C Hamano <gitster@pobox.com>,
konglu@minatec.inpg.fr,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Kong Lucien <Lucien.Kong@ensimag.imag.fr>,
Duperray Valentin <Valentin.Duperray@ensimag.imag.fr>,
Jonas Franck <Franck.Jonas@ensimag.imag.fr>,
Nguy Thomas <Thomas.Nguy@ensimag.imag.fr>,
Phil Hord <hordp@cisco.com>
Subject: [PATCHv3 4/4] Add tests for git-status --sequencer
Date: Fri, 9 Nov 2012 13:56:25 -0500 [thread overview]
Message-ID: <1352487385-5929-5-git-send-email-hordp@cisco.com> (raw)
In-Reply-To: <1352487385-5929-1-git-send-email-hordp@cisco.com>
Add t7061-status-sequence.sh with tests for the various
'git status --sequence' states.
I did not include tests for these states because I am not
sure how to induce these conditions organically yet:
conflicted am status
empty am status
rebase-interactive editing status
rebase-interactive splitting status
Signed-off-by: Phil Hord <hordp@cisco.com>
---
t/t7061-status-sequence.sh | 96 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
create mode 100755 t/t7061-status-sequence.sh
diff --git a/t/t7061-status-sequence.sh b/t/t7061-status-sequence.sh
new file mode 100755
index 0000000..db99822
--- /dev/null
+++ b/t/t7061-status-sequence.sh
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+test_description='sequencer state tokens'
+
+. ./test-lib.sh
+
+expect_tokens() {
+ for TOKEN in "$@" ; do
+ echo "## $TOKEN"
+ done | sort
+}
+
+status_has_only() {
+ expect_tokens "$@" >expect &&
+ git status -S | sort >actual &&
+ test_cmp expect actual
+}
+
+test_expect_success setup '
+ test_commit A &&
+ test_commit B oneside added &&
+ git checkout A^0 &&
+ test_commit C oneside created
+'
+
+test_expect_success 'status -S reports conflicted merge' '
+ git checkout B^0 &&
+ test_must_fail git merge C &&
+ status_has_only commit-pending conflicted merge
+'
+
+test_expect_success 'git reset --hard cleans up merge status' '
+ git reset --hard HEAD &&
+ status_has_only
+'
+
+test_expect_success 'status -S reports conflicted rebase' '
+ git reset --hard HEAD &&
+ git checkout B^0 &&
+ test_must_fail git rebase C &&
+ status_has_only conflicted rebase
+'
+
+test_expect_success 'git rebase --abort cleans up rebase status' '
+ git rebase --abort &&
+ status_has_only
+'
+
+test_expect_success 'status -S reports incomplete cherry-pick' '
+ git reset --hard HEAD &&
+ git checkout A &&
+ git cherry-pick --no-commit C &&
+ status_has_only commit-pending
+'
+
+test_expect_success 'completing commit cleans up pending commit status' '
+ git commit -mcompleted &&
+ status_has_only
+'
+
+test_expect_success 'status -S reports failed cherry-pick' '
+ git reset --hard HEAD &&
+ git checkout B &&
+ test_must_fail git cherry-pick C &&
+ status_has_only cherry-pick commit-pending conflicted
+'
+
+test_expect_success 'resolved conflicts clear conflicted status' '
+ git add oneside &&
+ status_has_only cherry-pick commit-pending
+'
+
+test_expect_success 'aborted cherry-pick clears cherry-pick status' '
+ git cherry-pick --abort &&
+ status_has_only
+'
+
+test_expect_success 'conflicted rebase-interactive status' '
+ git reset --hard HEAD &&
+ git checkout B &&
+ test_must_fail git rebase -i C &&
+ status_has_only rebase-interactive conflicted commit-pending
+'
+
+test_expect_success 'bisect status' '
+ git reset --hard HEAD &&
+ git bisect start &&
+ status_has_only bisect
+'
+
+test_expect_success 'bisect-reset clears bisect status' '
+ git bisect reset &&
+ status_has_only
+'
+
+test_done
--
1.8.0.3.gde9c7d5.dirty
prev parent reply other threads:[~2012-11-09 18:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 20:02 [PATCHv2] git-status: show short sequencer state Phil Hord
2012-10-23 20:02 ` Phil Hord
2012-10-25 9:29 ` Jeff King
2012-10-25 16:05 ` Phil Hord
2012-10-29 18:05 ` Phil Hord
2012-10-29 21:41 ` Jeff King
2012-10-29 22:26 ` Phil Hord
2012-10-29 23:31 ` [PATCHv2 0/3] git-status short sequencer state info Phil Hord
2012-10-29 23:31 ` [PATCHv2 1/3] Refactor print_state into get_state Phil Hord
2012-10-29 23:31 ` [PATCHv2 2/3] wt-status: More state retrieval abstraction Phil Hord
2012-10-29 23:31 ` [PATCHv2 3/3] git-status: show short sequencer state Phil Hord
2012-11-09 18:56 ` [PATCHv3 0/4] git-status short sequencer state info Phil Hord
2012-11-09 18:56 ` [PATCHv3 1/4] Refactor print_state into get_state Phil Hord
2012-11-12 18:29 ` Ramkumar Ramachandra
2012-11-09 18:56 ` [PATCHv3 2/4] wt-status: Teach sequencer advice to use get_state Phil Hord
2012-11-09 18:56 ` [PATCHv3 3/4] git-status: show short sequencer state Phil Hord
2012-11-12 17:45 ` Junio C Hamano
2012-11-12 18:14 ` Phil Hord
2012-11-13 23:50 ` Phil Hord
2012-11-14 13:29 ` Junio C Hamano
2012-11-14 13:44 ` Phil Hord
2012-11-14 17:44 ` Junio C Hamano
2012-11-14 19:14 ` Phil Hord
2012-11-14 19:35 ` Junio C Hamano
2012-11-14 19:57 ` Junio C Hamano
2012-11-09 18:56 ` Phil Hord [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352487385-5929-5-git-send-email-hordp@cisco.com \
--to=hordp@cisco.com \
--cc=Franck.Jonas@ensimag.imag.fr \
--cc=Lucien.Kong@ensimag.imag.fr \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=Thomas.Nguy@ensimag.imag.fr \
--cc=Valentin.Duperray@ensimag.imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=konglu@minatec.inpg.fr \
--cc=peff@peff.net \
--cc=phil.hord@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).