unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v2] test: exit with nonzero value when not all tests completed successfully
@ 2013-09-08 15:53 Tomi Ollila
  2013-09-08 17:38 ` Mark Walters
  2013-09-09  1:52 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Tomi Ollila @ 2013-09-08 15:53 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

If any of the tests in our test system is not passing the execution
of the test suite completes with nonzero exit value.

It is better to rely on the exit value of the test system instead
of some arbitrary strings in test output (or use both).
---

This is v2 of id:1378479935-26312-1-git-send-email-tomi.ollila@iki.fi
thanks to Mark's observation in id:87d2olg9bz.fsf@qmul.ac.uk
which widened my thought region :D

Tomi

 test/aggregate-results.sh | 9 +++++++++
 test/notmuch-test         | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh
index 732d6ca..b016edb 100755
--- a/test/aggregate-results.sh
+++ b/test/aggregate-results.sh
@@ -1,5 +1,7 @@
 #!/usr/bin/env bash
 
+set -eu
+
 fixed=0
 success=0
 failed=0
@@ -79,3 +81,10 @@ if [ "$skipped" != "0" ]; then
     tests=$(pluralize "test" $skipped)
     echo "$skipped $tests skipped."
 fi
+
+if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 -a $skipped -eq 0 ]
+then
+    exit 0
+else
+    exit 1
+fi
diff --git a/test/notmuch-test b/test/notmuch-test
index 6db7979..aa28bb0 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -97,6 +97,9 @@ trap - HUP INT TERM
 
 # Report results
 ./aggregate-results.sh test-results/*
+ev=$?
 
 # Clean up
 rm -rf test-results corpus.mail
+
+exit $ev
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] test: exit with nonzero value when not all tests completed successfully
  2013-09-08 15:53 [PATCH v2] test: exit with nonzero value when not all tests completed successfully Tomi Ollila
@ 2013-09-08 17:38 ` Mark Walters
  2013-09-09  1:52 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Walters @ 2013-09-08 17:38 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila


LGTM +1

Mark

On Sun, 08 Sep 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> If any of the tests in our test system is not passing the execution
> of the test suite completes with nonzero exit value.
>
> It is better to rely on the exit value of the test system instead
> of some arbitrary strings in test output (or use both).
> ---
>
> This is v2 of id:1378479935-26312-1-git-send-email-tomi.ollila@iki.fi
> thanks to Mark's observation in id:87d2olg9bz.fsf@qmul.ac.uk
> which widened my thought region :D
>
> Tomi
>
>  test/aggregate-results.sh | 9 +++++++++
>  test/notmuch-test         | 3 +++
>  2 files changed, 12 insertions(+)
>
> diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh
> index 732d6ca..b016edb 100755
> --- a/test/aggregate-results.sh
> +++ b/test/aggregate-results.sh
> @@ -1,5 +1,7 @@
>  #!/usr/bin/env bash
>  
> +set -eu
> +
>  fixed=0
>  success=0
>  failed=0
> @@ -79,3 +81,10 @@ if [ "$skipped" != "0" ]; then
>      tests=$(pluralize "test" $skipped)
>      echo "$skipped $tests skipped."
>  fi
> +
> +if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 -a $skipped -eq 0 ]
> +then
> +    exit 0
> +else
> +    exit 1
> +fi
> diff --git a/test/notmuch-test b/test/notmuch-test
> index 6db7979..aa28bb0 100755
> --- a/test/notmuch-test
> +++ b/test/notmuch-test
> @@ -97,6 +97,9 @@ trap - HUP INT TERM
>  
>  # Report results
>  ./aggregate-results.sh test-results/*
> +ev=$?
>  
>  # Clean up
>  rm -rf test-results corpus.mail
> +
> +exit $ev
> -- 
> 1.8.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] test: exit with nonzero value when not all tests completed successfully
  2013-09-08 15:53 [PATCH v2] test: exit with nonzero value when not all tests completed successfully Tomi Ollila
  2013-09-08 17:38 ` Mark Walters
@ 2013-09-09  1:52 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2013-09-09  1:52 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

Tomi Ollila <tomi.ollila@iki.fi> writes:

> If any of the tests in our test system is not passing the execution
> of the test suite completes with nonzero exit value.

pushed, 

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-09  1:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-08 15:53 [PATCH v2] test: exit with nonzero value when not all tests completed successfully Tomi Ollila
2013-09-08 17:38 ` Mark Walters
2013-09-09  1:52 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).