From: Pat Thoyts <patthoyts@users.sourceforge.net>
To: Git Mailing List <git@vger.kernel.org>
Cc: msysGit <msysgit@googlegroups.com>,
Junio C Hamano <gitster@pobox.com>,
Pat Thoyts <patthoyts@users.sourceforge.net>
Subject: [PATCH 4/4] t5526: avoid dependency on submodule order
Date: Thu, 3 Feb 2011 15:31:45 +0000 [thread overview]
Message-ID: <1296747105-1663-5-git-send-email-patthoyts@users.sourceforge.net> (raw)
In-Reply-To: <1296747105-1663-1-git-send-email-patthoyts@users.sourceforge.net>
When running tests on msysGit the actual results appear in the reverse
order. Added a test_cmp_unordered to test that each expected line is
present in the output without depending upon the order of lines.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
t/t5526-fetch-submodules.sh | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 884a5e5..d218845 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -32,6 +32,10 @@ add_upstream_commit() {
)
}
+test_cmp_unordered() {
+ grep --line-regexp -f "$@" >&3
+}
+
test_expect_success setup '
mkdir deepsubmodule &&
(
@@ -67,8 +71,8 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
cd downstream &&
git fetch --recurse-submodules >../actual.out 2>../actual.err
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err
'
test_expect_success "fetch alone only fetches superproject" '
@@ -96,8 +100,8 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
git fetch >../actual.out 2>../actual.err
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err
'
test_expect_success "--no-recurse-submodules overrides .gitmodules config" '
@@ -127,8 +131,8 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
git config -f --unset .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
git config --unset submodule.submodule.fetchRecurseSubmodules
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err
'
test_expect_success "--quiet propagates to submodules" '
@@ -146,14 +150,14 @@ test_expect_success "--dry-run propagates to submodules" '
cd downstream &&
git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err &&
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err &&
(
cd downstream &&
git fetch --recurse-submodules >../actual.out 2>../actual.err
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err
'
test_expect_success "recurseSubmodules=true propagates into submodules" '
@@ -163,8 +167,8 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
git config fetch.recurseSubmodules true
git fetch >../actual.out 2>../actual.err
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err
'
test_expect_success "--recurse-submodules overrides config in submodule" '
@@ -177,8 +181,8 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
) &&
git fetch --recurse-submodules >../actual.out 2>../actual.err
) &&
- test_cmp expect.out actual.out &&
- test_cmp expect.err actual.err
+ test_cmp_unordered expect.out actual.out &&
+ test_cmp_unordered expect.err actual.err
'
test_expect_success "--no-recurse-submodules overrides config setting" '
--
1.7.4.msysgit.0
next prev parent reply other threads:[~2011-02-03 15:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 15:31 [PATCH] some test fixes for msysGit Pat Thoyts
2011-02-03 15:31 ` [PATCH 1/4] t3509: use unconstrained initial test to setup repository Pat Thoyts
2011-02-03 15:31 ` [PATCH 2/4] t4120-apply-popt: help systems with core.filemode=false Pat Thoyts
2011-02-03 15:31 ` [PATCH 3/4] t7407: fix line endings for mingw build Pat Thoyts
2011-02-03 15:31 ` Pat Thoyts [this message]
2011-02-03 20:08 ` [msysGit] [PATCH 4/4] t5526: avoid dependency on submodule order Johannes Sixt
2011-02-03 20:26 ` Johannes Schindelin
2011-02-03 20:56 ` Johannes Sixt
2011-02-04 8:41 ` [PATCH maint] start_command: flush buffers in the WIN32 code path as well Johannes Sixt
2011-02-04 11:23 ` Pat Thoyts
2011-02-03 16:29 ` [msysGit] [PATCH] some test fixes for msysGit Johannes Schindelin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296747105-1663-5-git-send-email-patthoyts@users.sourceforge.net \
--to=patthoyts@users.sourceforge.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=msysgit@googlegroups.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.
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 NNTP newsgroup(s).