From: Eric Sunshine <sunshine@sunshineco.com>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 3/6] t5000: factor out check_tar
Date: Mon, 20 May 2013 15:54:36 -0400 [thread overview]
Message-ID: <CAPig+cSPV08=LcQ4vziE5+HmN3LtBVp7F4mb83--Mub_e2A7qw@mail.gmail.com> (raw)
In-Reply-To: <1369043909-59207-4-git-send-email-rene.scharfe@lsrfire.ath.cx>
On Mon, May 20, 2013 at 5:58 AM, René Scharfe
<rene.scharfe@lsrfire.ath.cx> wrote:
> Create a helper function that extracts a tar archive and checks its
> contents, modelled after check_zip in t5003.
>
> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
> ---
> t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------
> 1 file changed, 22 insertions(+), 13 deletions(-)
>
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index 41cd609..8337a1f 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}
>
> SUBSTFORMAT=%H%n
>
> +check_tar() {
> + tarfile=$1.tar
> + listfile=$1.lst
> + dir=$1
> + dir_with_prefix=$dir/$2
> +
> + test_expect_success ' extract tar archive' '
s/' extract/'extract/
> + (mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
> + '
> +
> + test_expect_success ' validate filenames' '
s/' validate/'validate/
> + (cd ${dir_with_prefix}a && find .) | sort >$listfile &&
> + test_cmp a.lst $listfile
> + '
> +
> + test_expect_success ' validate file contents' '
s/' validate/'validate/
> + diff -r a ${dir_with_prefix}a
> + '
> +}
> +
> test_expect_success \
> 'populate workdir' \
> 'mkdir a &&
> @@ -81,6 +101,8 @@ test_expect_success \
> 'git archive' \
> 'git archive HEAD >b.tar'
>
> +check_tar b
> +
> test_expect_success \
> 'git tar-tree' \
> 'git tar-tree HEAD >b2.tar'
> @@ -125,19 +147,6 @@ test_expect_success \
> test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
>
> test_expect_success \
> - 'extract tar archive' \
> - '(mkdir b && cd b && "$TAR" xf -) <b.tar'
> -
> -test_expect_success \
> - 'validate filenames' \
> - '(cd b/a && find .) | sort >b.lst &&
> - test_cmp a.lst b.lst'
> -
> -test_expect_success \
> - 'validate file contents' \
> - 'diff -r a b/a'
> -
> -test_expect_success \
> 'git tar-tree with prefix' \
> 'git tar-tree HEAD prefix >c.tar'
>
> --
> 1.8.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-05-20 19:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
2013-05-20 9:58 ` [PATCH 1/6] t5000: integrate export-subst tests into regular tests René Scharfe
2013-05-20 19:53 ` Eric Sunshine
2013-05-20 20:22 ` René Scharfe
2013-05-20 9:58 ` [PATCH 2/6] t5000, t5003: create directories for extracted files lazily René Scharfe
2013-05-20 9:58 ` [PATCH 3/6] t5000: factor out check_tar René Scharfe
2013-05-20 19:54 ` Eric Sunshine [this message]
2013-05-20 20:22 ` René Scharfe
2013-05-20 9:58 ` [PATCH 4/6] t5000: use check_tar for prefix test René Scharfe
2013-05-20 9:58 ` [PATCH 5/6] t5000: simplify tar-tree tests René Scharfe
2013-05-20 9:58 ` [PATCH 6/6] t5000: test long filenames René Scharfe
2013-05-20 19:55 ` Eric Sunshine
[not found] ` <CAPig+cTitT9Z+2pxeNh3dXi4b7X738qpkUnEmTi2yvQoCPtHqA@mail.g mail.com>
2013-05-20 20:01 ` (unknown), Marty Landman
2013-05-20 11:43 ` [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
2013-05-20 22:48 ` Junio C Hamano
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='CAPig+cSPV08=LcQ4vziE5+HmN3LtBVp7F4mb83--Mub_e2A7qw@mail.gmail.com' \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=rene.scharfe@lsrfire.ath.cx \
/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).