Re: [GUILT v2 07/29] Added test cases for "guilt fold".
- From
- Jeff Sipek <jeffpc@josefsipek.net>
- Date
- May 13, 2014, 21:30 UTC
- Message-ID
- <20140513213024.GF4791@meili.valhalla.31bits.net>
- In-Reply-To
- <1400013065-27919-8-git-send-email-cederp@opera.com>
On Tue, May 13, 2014 at 10:30:43PM +0200, Per Cederqvist wrote:
Show 12 quoted lines
> Test that we can combine any combination of patches with empty and > non-empty messages, both with and without guilt.diffstat. (All > patches are empty.) > > Signed-off-by: Per Cederqvist <cederp@opera.com> > --- > regression/t-035.out | 467 +++++++++++++++++++++++++++++++++++++++++++++++++++ > regression/t-035.sh | 62 +++++++ > 2 files changed, 529 insertions(+) > create mode 100644 regression/t-035.out > create mode 100755 regression/t-035.sh >
...
Show 47 quoted lines
> diff --git a/regression/t-035.sh b/regression/t-035.sh
> new file mode 100755
> index 0000000..e914b32
> --- /dev/null
> +++ b/regression/t-035.sh
> @@ -0,0 +1,62 @@
> +#!/bin/bash
> +#
> +# Test the fold code
> +#
> +
> +source "$REG_DIR/scaffold"
> +
> +cmd setup_repo
> +
> +function fixup_time_info
> +{
> + cmd guilt pop
> + touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
> + cmd guilt push
> +}
> +
> +function empty_patch
> +{
> + cmd guilt new "empty$1"
> + fixup_time_info "empty$1"
> +}
> +
> +function nonempty_patch
> +{
> + if [ "$1" = -2 ]; then
> + msg="Another commit message."
> + else
> + msg="A commit message."
> + fi
> +
> + cmd guilt new -f -s -m "$msg" "nonempty$1"
> + fixup_time_info "nonempty$1"
> +}
> +
> +for using_diffstat in true false; do
> + cmd git config guilt.diffstat $using_diffstat
> + for patcha in empty nonempty; do
> + for patchb in empty nonempty; do
> +
> + if [ $patcha = $patchb ]
> + thenI know that this is before patch 29, but ... style? ;)
Otherwise, looks good. I like this way better than the unrolled loop in v1 of this patch.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Show 24 quoted lines
> + suffixa=-1
> + suffixb=-2
> + else
> + suffixa=
> + suffixb=
> + fi
> +
> + echo "%% $patcha + $patchb (diffstat=$using_diffstat)"
> + ${patcha}_patch $suffixa
> + ${patchb}_patch $suffixb
> + cmd guilt pop
> + cmd guilt fold $patchb$suffixb
> + fixup_time_info $patcha$suffixa
> + cmd list_files
> + cmd guilt pop
> + cmd guilt delete -f $patcha$suffixa
> + cmd list_files
> +
> + done
> + done
> +done
> --
> 1.8.3.1
> -- *NOTE: This message is ROT-13 encrypted twice for extra protection*