"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: regress/cmdline/*.sh: add missing returns
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 28 Aug 2021 15:55:32 +0200

Download raw body.

Thread
On Sat, Aug 28, 2021 at 03:28:07PM +0200, Christian Weisgerber wrote:
> Christian Weisgerber:
> 
> > test failed; leaving test data in /tmp/got-test-rebase_basic-vSRixm6A
> > $ ls /tmp/got-test-rebase_basic-vSRixm6A
> > ls: /tmp/got-test-rebase_basic-vSRixm6A: No such file or directory
> 
> That's caused by a missing "return 1" after a "test_done".
> In fact, this mistake is repeated several times throughout the
> regression tests.
> 
> OK?
> 

Yes, thanks!

> diff 27b75514d9b1c8e9f188ef9c483760647a8c1b72 /home/naddy/got
> blob - 833165f283719f7e31abc68547ab8bd9be6e8ba5
> file + regress/cmdline/commit.sh
> --- regress/cmdline/commit.sh
> +++ regress/cmdline/commit.sh
> @@ -936,6 +936,7 @@ commit_check_mode() {
>  	if [ "$ret" != "0" ]; then
>  		diff -u $testroot/stdout.expected $testroot/stdout
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	local tree_id=$(got cat -r $testroot/repo $commit_id | \
> blob - 15eedc6e738a474075643efa1fcd4692f2e2cec1
> file + regress/cmdline/histedit.sh
> --- regress/cmdline/histedit.sh
> +++ regress/cmdline/histedit.sh
> @@ -147,6 +147,7 @@ test_histedit_no_op() {
>  	if [ "$ret" != "0" ]; then
>  		diff -u $testroot/stdout.expected $testroot/stdout
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# We should have a backup of old commits
> blob - dafaee11118bbd5a0402ea44f97b94380d8cb973
> file + regress/cmdline/log.sh
> --- regress/cmdline/log.sh
> +++ regress/cmdline/log.sh
> @@ -580,6 +580,7 @@ test_log_reverse_display() {
>  	if [ "$ret" != "0" ]; then
>  		diff -u $testroot/stdout.expected $testroot/stdout
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# commit matching with -s applies before -R
> blob - 6d5ebb983005fdef61cb6e02c5ffb1acbf3d065c
> file + regress/cmdline/rebase.sh
> --- regress/cmdline/rebase.sh
> +++ regress/cmdline/rebase.sh
> @@ -148,6 +148,7 @@ test_rebase_basic() {
>  	if [ "$ret" != "0" ]; then
>  		diff -u $testroot/stdout.expected $testroot/stdout
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# We should have a backup of old commits
> @@ -173,6 +174,7 @@ EOF
>  	if [ "$ret" != "0" ]; then
>  		diff -u $testroot/stdout.expected $testroot/stdout
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# Asking for backups of a branch which has none should yield an error
> @@ -972,6 +974,7 @@ test_rebase_forward() {
>  	if [ "$ret" != "0" ]; then
>  		diff -u $testroot/stdout.expected $testroot/stdout
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# Forward-only rebase operations should not be backed up
> blob - 98a9f97817406af6ab4f6951d6ad39093468880c
> file + regress/cmdline/ref.sh
> --- regress/cmdline/ref.sh
> +++ regress/cmdline/ref.sh
> @@ -69,6 +69,7 @@ test_ref_create() {
>  	if [ "$ret" != "0" ]; then
>  		echo "git checkout command failed unexpectedly"
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# Create a symbolic ref
> blob - c5ae022a52f93b0d0bfba22ab27f066d4e1957d6
> file + regress/cmdline/tag.sh
> --- regress/cmdline/tag.sh
> +++ regress/cmdline/tag.sh
> @@ -84,6 +84,7 @@ test_tag_create() {
>  	if [ "$ret" != "0" ]; then
>  		echo "git checkout command failed unexpectedly"
>  		test_done "$testroot" "$ret"
> +		return 1
>  	fi
>  
>  	# Attempt to create a tag pointing at a non-commit
> -- 
> Christian "naddy" Weisgerber                          naddy@mips.inka.de
> 
>