unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] test: basic: drop 'ensure all available tests are run'
@ 2014-01-09 15:18 Tomi Ollila
  2014-01-09 15:18 ` [PATCH 2/2] test: renamed test scripts to format T\d\d\d-name.sh Tomi Ollila
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Tomi Ollila @ 2014-01-09 15:18 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

When naming test scripts in format 'T\d\d\d-name.sh' the list of
tests to run are created dynamically. This makes test

'Ensure that all available tests will be run by notmuch-test'

in test/basic obsolete.
---
 test/basic | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/test/basic b/test/basic
index f7eed32..9c94b62 100755
--- a/test/basic
+++ b/test/basic
@@ -49,24 +49,6 @@ test_expect_code 2 'failure to clean up causes the test to fail' '
     test_when_finished "(exit 2)"
 '
 
-# Ensure that all tests are being run
-test_begin_subtest 'Ensure that all available tests will be run by notmuch-test'
-eval $(sed -n -e '/^TESTS="$/,/^"$/p' $TEST_DIRECTORY/notmuch-test)
-tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
-available=$(find "$TEST_DIRECTORY" -maxdepth 1 -type f \
-   '(' -perm -100 -o -perm -10 -o -perm -1 ')' \
-    ! -name aggregate-results.sh	\
-    ! -name arg-test			\
-    ! -name hex-xcode			\
-    ! -name notmuch-test		\
-    ! -name parse-time			\
-    ! -name random-corpus		\
-    ! -name smtp-dummy			\
-    ! -name symbol-test			\
-    ! -name test-verbose		\
-    | sed 's,.*/,,' | sort)
-test_expect_equal "$tests_in_suite" "$available"
-
 EXPECTED=$TEST_DIRECTORY/test.expected-output
 suppress_diff_date() {
     sed -e 's/\(.*\-\-\- test-verbose\.4\.\expected\).*/\1/' \
-- 
1.8.4.2

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

* [PATCH 2/2] test: renamed test scripts to format T\d\d\d-name.sh
  2014-01-09 15:18 [PATCH 1/2] test: basic: drop 'ensure all available tests are run' Tomi Ollila
@ 2014-01-09 15:18 ` Tomi Ollila
  2014-01-12  0:28 ` [PATCH 1/2] test: basic: drop 'ensure all available tests are run' David Bremner
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Tomi Ollila @ 2014-01-09 15:18 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

All test scripts to be executed are now named as T\d\d\d-name.sh,
numers in increments of 10.

This eases adding new tests and developers to see which are test scripts
that are executed by test suite and in which order.
---

Renaming was done using (beware! bash syntax ;):

c=0
for f in $TESTS
do
        printf -v name "T%03d-%s.sh" $c $f;
        git mv $f $name
        c=$((c + 10))
done

and git format-patch -M HEAD^^ was used to create this patch set.

No reordering was done to the test set. I can do that in case Someone(TM)
provides me ${TESTS} in desired order

I plan to write 'rename-tests' script which can be used to rename tests
in current order to have 10 -increments again (first testing that all
T*.sh files to be rennamed are in git and then that there is no duplicate
names (or something), but that is done after these changes are approved...


 test/{basic => T000-basic.sh}                      |  0
 test/{help-test => T010-help-test.sh}              |  0
 test/{compact => T020-compact.sh}                  |  0
 test/{config => T030-config.sh}                    |  0
 test/{setup => T040-setup.sh}                      |  0
 test/{new => T050-new.sh}                          |  0
 test/{count => T060-count.sh}                      |  0
 test/{insert => T070-insert.sh}                    |  0
 test/{search => T080-search.sh}                    |  0
 test/{search-output => T090-search-output.sh}      |  0
 .../{search-by-folder => T100-search-by-folder.sh} |  0
 ...lap-bug => T110-search-position-overlap-bug.sh} |  0
 ...ng => T120-search-insufficient-from-quoting.sh} |  0
 test/{search-limiting => T130-search-limiting.sh}  |  0
 test/{excludes => T140-excludes.sh}                |  0
 test/{tagging => T150-tagging.sh}                  |  0
 test/{json => T160-json.sh}                        |  0
 test/{sexp => T170-sexp.sh}                        |  0
 test/{text => T180-text.sh}                        |  0
 test/{multipart => T190-multipart.sh}              |  0
 test/{thread-naming => T200-thread-naming.sh}      |  0
 test/{raw => T210-raw.sh}                          |  0
 test/{reply => T220-reply.sh}                      |  0
 test/{reply-to-sender => T230-reply-to-sender.sh}  |  0
 test/{dump-restore => T240-dump-restore.sh}        |  0
 test/{uuencode => T250-uuencode.sh}                |  0
 test/{thread-order => T260-thread-order.sh}        |  0
 test/{author-order => T270-author-order.sh}        |  0
 test/{from-guessing => T280-from-guessing.sh}      |  0
 test/{long-id => T290-long-id.sh}                  |  0
 test/{encoding => T300-encoding.sh}                |  0
 test/{emacs => T310-emacs.sh}                      |  0
 ...ch-buffer => T320-emacs-large-search-buffer.sh} |  0
 ...-filename => T330-emacs-subject-to-filename.sh} |  0
 test/{maildir-sync => T340-maildir-sync.sh}        |  0
 test/{crypto => T350-crypto.sh}                    |  0
 test/{symbol-hiding => T360-symbol-hiding.sh}      |  0
 ...r-coherence => T370-search-folder-coherence.sh} |  0
 test/{atomicity => T380-atomicity.sh}              |  0
 test/{python => T390-python.sh}                    |  0
 test/{hooks => T400-hooks.sh}                      |  0
 .../{argument-parsing => T410-argument-parsing.sh} |  0
 ...test-functions => T420-emacs-test-functions.sh} |  0
 ...ess-cleaning => T430-emacs-address-cleaning.sh} |  0
 test/{emacs-hello => T440-emacs-hello.sh}          |  0
 test/{emacs-show => T450-emacs-show.sh}            |  0
 test/{emacs-tree => T460-emacs-tree.sh}            |  0
 test/{missing-headers => T470-missing-headers.sh}  |  0
 test/{hex-escaping => T480-hex-escaping.sh}        |  0
 ...parse-time-string => T490-parse-time-string.sh} |  0
 test/{search-date => T500-search-date.sh}          |  0
 test/{thread-replies => T510-thread-replies.sh}    |  0
 test/notmuch-test                                  | 56 +---------------------
 test/test-lib.sh                                   |  1 +
 54 files changed, 2 insertions(+), 55 deletions(-)
 rename test/{basic => T000-basic.sh} (100%)
 rename test/{help-test => T010-help-test.sh} (100%)
 rename test/{compact => T020-compact.sh} (100%)
 rename test/{config => T030-config.sh} (100%)
 rename test/{setup => T040-setup.sh} (100%)
 rename test/{new => T050-new.sh} (100%)
 rename test/{count => T060-count.sh} (100%)
 rename test/{insert => T070-insert.sh} (100%)
 rename test/{search => T080-search.sh} (100%)
 rename test/{search-output => T090-search-output.sh} (100%)
 rename test/{search-by-folder => T100-search-by-folder.sh} (100%)
 rename test/{search-position-overlap-bug => T110-search-position-overlap-bug.sh} (100%)
 rename test/{search-insufficient-from-quoting => T120-search-insufficient-from-quoting.sh} (100%)
 rename test/{search-limiting => T130-search-limiting.sh} (100%)
 rename test/{excludes => T140-excludes.sh} (100%)
 rename test/{tagging => T150-tagging.sh} (100%)
 rename test/{json => T160-json.sh} (100%)
 rename test/{sexp => T170-sexp.sh} (100%)
 rename test/{text => T180-text.sh} (100%)
 rename test/{multipart => T190-multipart.sh} (100%)
 rename test/{thread-naming => T200-thread-naming.sh} (100%)
 rename test/{raw => T210-raw.sh} (100%)
 rename test/{reply => T220-reply.sh} (100%)
 rename test/{reply-to-sender => T230-reply-to-sender.sh} (100%)
 rename test/{dump-restore => T240-dump-restore.sh} (100%)
 rename test/{uuencode => T250-uuencode.sh} (100%)
 rename test/{thread-order => T260-thread-order.sh} (100%)
 rename test/{author-order => T270-author-order.sh} (100%)
 rename test/{from-guessing => T280-from-guessing.sh} (100%)
 rename test/{long-id => T290-long-id.sh} (100%)
 rename test/{encoding => T300-encoding.sh} (100%)
 rename test/{emacs => T310-emacs.sh} (100%)
 rename test/{emacs-large-search-buffer => T320-emacs-large-search-buffer.sh} (100%)
 rename test/{emacs-subject-to-filename => T330-emacs-subject-to-filename.sh} (100%)
 rename test/{maildir-sync => T340-maildir-sync.sh} (100%)
 rename test/{crypto => T350-crypto.sh} (100%)
 rename test/{symbol-hiding => T360-symbol-hiding.sh} (100%)
 rename test/{search-folder-coherence => T370-search-folder-coherence.sh} (100%)
 rename test/{atomicity => T380-atomicity.sh} (100%)
 rename test/{python => T390-python.sh} (100%)
 rename test/{hooks => T400-hooks.sh} (100%)
 rename test/{argument-parsing => T410-argument-parsing.sh} (100%)
 rename test/{emacs-test-functions => T420-emacs-test-functions.sh} (100%)
 rename test/{emacs-address-cleaning => T430-emacs-address-cleaning.sh} (100%)
 rename test/{emacs-hello => T440-emacs-hello.sh} (100%)
 rename test/{emacs-show => T450-emacs-show.sh} (100%)
 rename test/{emacs-tree => T460-emacs-tree.sh} (100%)
 rename test/{missing-headers => T470-missing-headers.sh} (100%)
 rename test/{hex-escaping => T480-hex-escaping.sh} (100%)
 rename test/{parse-time-string => T490-parse-time-string.sh} (100%)
 rename test/{search-date => T500-search-date.sh} (100%)
 rename test/{thread-replies => T510-thread-replies.sh} (100%)

diff --git a/test/basic b/test/T000-basic.sh
similarity index 100%
rename from test/basic
rename to test/T000-basic.sh
diff --git a/test/help-test b/test/T010-help-test.sh
similarity index 100%
rename from test/help-test
rename to test/T010-help-test.sh
diff --git a/test/compact b/test/T020-compact.sh
similarity index 100%
rename from test/compact
rename to test/T020-compact.sh
diff --git a/test/config b/test/T030-config.sh
similarity index 100%
rename from test/config
rename to test/T030-config.sh
diff --git a/test/setup b/test/T040-setup.sh
similarity index 100%
rename from test/setup
rename to test/T040-setup.sh
diff --git a/test/new b/test/T050-new.sh
similarity index 100%
rename from test/new
rename to test/T050-new.sh
diff --git a/test/count b/test/T060-count.sh
similarity index 100%
rename from test/count
rename to test/T060-count.sh
diff --git a/test/insert b/test/T070-insert.sh
similarity index 100%
rename from test/insert
rename to test/T070-insert.sh
diff --git a/test/search b/test/T080-search.sh
similarity index 100%
rename from test/search
rename to test/T080-search.sh
diff --git a/test/search-output b/test/T090-search-output.sh
similarity index 100%
rename from test/search-output
rename to test/T090-search-output.sh
diff --git a/test/search-by-folder b/test/T100-search-by-folder.sh
similarity index 100%
rename from test/search-by-folder
rename to test/T100-search-by-folder.sh
diff --git a/test/search-position-overlap-bug b/test/T110-search-position-overlap-bug.sh
similarity index 100%
rename from test/search-position-overlap-bug
rename to test/T110-search-position-overlap-bug.sh
diff --git a/test/search-insufficient-from-quoting b/test/T120-search-insufficient-from-quoting.sh
similarity index 100%
rename from test/search-insufficient-from-quoting
rename to test/T120-search-insufficient-from-quoting.sh
diff --git a/test/search-limiting b/test/T130-search-limiting.sh
similarity index 100%
rename from test/search-limiting
rename to test/T130-search-limiting.sh
diff --git a/test/excludes b/test/T140-excludes.sh
similarity index 100%
rename from test/excludes
rename to test/T140-excludes.sh
diff --git a/test/tagging b/test/T150-tagging.sh
similarity index 100%
rename from test/tagging
rename to test/T150-tagging.sh
diff --git a/test/json b/test/T160-json.sh
similarity index 100%
rename from test/json
rename to test/T160-json.sh
diff --git a/test/sexp b/test/T170-sexp.sh
similarity index 100%
rename from test/sexp
rename to test/T170-sexp.sh
diff --git a/test/text b/test/T180-text.sh
similarity index 100%
rename from test/text
rename to test/T180-text.sh
diff --git a/test/multipart b/test/T190-multipart.sh
similarity index 100%
rename from test/multipart
rename to test/T190-multipart.sh
diff --git a/test/thread-naming b/test/T200-thread-naming.sh
similarity index 100%
rename from test/thread-naming
rename to test/T200-thread-naming.sh
diff --git a/test/raw b/test/T210-raw.sh
similarity index 100%
rename from test/raw
rename to test/T210-raw.sh
diff --git a/test/reply b/test/T220-reply.sh
similarity index 100%
rename from test/reply
rename to test/T220-reply.sh
diff --git a/test/reply-to-sender b/test/T230-reply-to-sender.sh
similarity index 100%
rename from test/reply-to-sender
rename to test/T230-reply-to-sender.sh
diff --git a/test/dump-restore b/test/T240-dump-restore.sh
similarity index 100%
rename from test/dump-restore
rename to test/T240-dump-restore.sh
diff --git a/test/uuencode b/test/T250-uuencode.sh
similarity index 100%
rename from test/uuencode
rename to test/T250-uuencode.sh
diff --git a/test/thread-order b/test/T260-thread-order.sh
similarity index 100%
rename from test/thread-order
rename to test/T260-thread-order.sh
diff --git a/test/author-order b/test/T270-author-order.sh
similarity index 100%
rename from test/author-order
rename to test/T270-author-order.sh
diff --git a/test/from-guessing b/test/T280-from-guessing.sh
similarity index 100%
rename from test/from-guessing
rename to test/T280-from-guessing.sh
diff --git a/test/long-id b/test/T290-long-id.sh
similarity index 100%
rename from test/long-id
rename to test/T290-long-id.sh
diff --git a/test/encoding b/test/T300-encoding.sh
similarity index 100%
rename from test/encoding
rename to test/T300-encoding.sh
diff --git a/test/emacs b/test/T310-emacs.sh
similarity index 100%
rename from test/emacs
rename to test/T310-emacs.sh
diff --git a/test/emacs-large-search-buffer b/test/T320-emacs-large-search-buffer.sh
similarity index 100%
rename from test/emacs-large-search-buffer
rename to test/T320-emacs-large-search-buffer.sh
diff --git a/test/emacs-subject-to-filename b/test/T330-emacs-subject-to-filename.sh
similarity index 100%
rename from test/emacs-subject-to-filename
rename to test/T330-emacs-subject-to-filename.sh
diff --git a/test/maildir-sync b/test/T340-maildir-sync.sh
similarity index 100%
rename from test/maildir-sync
rename to test/T340-maildir-sync.sh
diff --git a/test/crypto b/test/T350-crypto.sh
similarity index 100%
rename from test/crypto
rename to test/T350-crypto.sh
diff --git a/test/symbol-hiding b/test/T360-symbol-hiding.sh
similarity index 100%
rename from test/symbol-hiding
rename to test/T360-symbol-hiding.sh
diff --git a/test/search-folder-coherence b/test/T370-search-folder-coherence.sh
similarity index 100%
rename from test/search-folder-coherence
rename to test/T370-search-folder-coherence.sh
diff --git a/test/atomicity b/test/T380-atomicity.sh
similarity index 100%
rename from test/atomicity
rename to test/T380-atomicity.sh
diff --git a/test/python b/test/T390-python.sh
similarity index 100%
rename from test/python
rename to test/T390-python.sh
diff --git a/test/hooks b/test/T400-hooks.sh
similarity index 100%
rename from test/hooks
rename to test/T400-hooks.sh
diff --git a/test/argument-parsing b/test/T410-argument-parsing.sh
similarity index 100%
rename from test/argument-parsing
rename to test/T410-argument-parsing.sh
diff --git a/test/emacs-test-functions b/test/T420-emacs-test-functions.sh
similarity index 100%
rename from test/emacs-test-functions
rename to test/T420-emacs-test-functions.sh
diff --git a/test/emacs-address-cleaning b/test/T430-emacs-address-cleaning.sh
similarity index 100%
rename from test/emacs-address-cleaning
rename to test/T430-emacs-address-cleaning.sh
diff --git a/test/emacs-hello b/test/T440-emacs-hello.sh
similarity index 100%
rename from test/emacs-hello
rename to test/T440-emacs-hello.sh
diff --git a/test/emacs-show b/test/T450-emacs-show.sh
similarity index 100%
rename from test/emacs-show
rename to test/T450-emacs-show.sh
diff --git a/test/emacs-tree b/test/T460-emacs-tree.sh
similarity index 100%
rename from test/emacs-tree
rename to test/T460-emacs-tree.sh
diff --git a/test/missing-headers b/test/T470-missing-headers.sh
similarity index 100%
rename from test/missing-headers
rename to test/T470-missing-headers.sh
diff --git a/test/hex-escaping b/test/T480-hex-escaping.sh
similarity index 100%
rename from test/hex-escaping
rename to test/T480-hex-escaping.sh
diff --git a/test/parse-time-string b/test/T490-parse-time-string.sh
similarity index 100%
rename from test/parse-time-string
rename to test/T490-parse-time-string.sh
diff --git a/test/search-date b/test/T500-search-date.sh
similarity index 100%
rename from test/search-date
rename to test/T500-search-date.sh
diff --git a/test/thread-replies b/test/T510-thread-replies.sh
similarity index 100%
rename from test/thread-replies
rename to test/T510-thread-replies.sh
diff --git a/test/notmuch-test b/test/notmuch-test
index d6fdd3a..b843712 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -16,61 +16,7 @@ fi
 
 cd $(dirname "$0")
 
-TESTS="
-  basic
-  help-test
-  compact
-  config
-  setup
-  new
-  count
-  insert
-  search
-  search-output
-  search-by-folder
-  search-position-overlap-bug
-  search-insufficient-from-quoting
-  search-limiting
-  excludes
-  tagging
-  json
-  sexp
-  text
-  multipart
-  thread-naming
-  raw
-  reply
-  reply-to-sender
-  dump-restore
-  uuencode
-  thread-order
-  author-order
-  from-guessing
-  long-id
-  encoding
-  emacs
-  emacs-large-search-buffer
-  emacs-subject-to-filename
-  maildir-sync
-  crypto
-  symbol-hiding
-  search-folder-coherence
-  atomicity
-  python
-  hooks
-  argument-parsing
-  emacs-test-functions
-  emacs-address-cleaning
-  emacs-hello
-  emacs-show
-  emacs-tree
-  missing-headers
-  hex-escaping
-  parse-time-string
-  search-date
-  thread-replies
-"
-TESTS=${NOTMUCH_TESTS:=$TESTS}
+TESTS=${NOTMUCH_TESTS:-`echo T[0-9][0-9][0-9]-*.sh`}
 
 # Clean up any results from a previous run
 rm -r test-results >/dev/null 2>/dev/null
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 2fcaba6..487075e 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -27,6 +27,7 @@ shopt -u xpg_echo
 
 this_test=${0##*/}
 this_test=${this_test%.sh}
+this_test=${this_test#T[0-9][0-9][0-9]-}
 
 # if --tee was passed, write the output not only to the terminal, but
 # additionally to the file test-results/$BASENAME.out, too.
-- 
1.8.4.2

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

* Re: [PATCH 1/2] test: basic: drop 'ensure all available tests are run'
  2014-01-09 15:18 [PATCH 1/2] test: basic: drop 'ensure all available tests are run' Tomi Ollila
  2014-01-09 15:18 ` [PATCH 2/2] test: renamed test scripts to format T\d\d\d-name.sh Tomi Ollila
@ 2014-01-12  0:28 ` David Bremner
  2014-01-13 18:37 ` David Bremner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: David Bremner @ 2014-01-12  0:28 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

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

> When naming test scripts in format 'T\d\d\d-name.sh' the list of
> tests to run are created dynamically. This makes test

Series LGTM. Queuing..

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

* Re: [PATCH 1/2] test: basic: drop 'ensure all available tests are run'
  2014-01-09 15:18 [PATCH 1/2] test: basic: drop 'ensure all available tests are run' Tomi Ollila
  2014-01-09 15:18 ` [PATCH 2/2] test: renamed test scripts to format T\d\d\d-name.sh Tomi Ollila
  2014-01-12  0:28 ` [PATCH 1/2] test: basic: drop 'ensure all available tests are run' David Bremner
@ 2014-01-13 18:37 ` David Bremner
  2014-01-13 19:25 ` [PATCH 1/1] test: check that expected results file exists when test script exits != 0 Tomi Ollila
  2014-01-13 20:38 ` [PATCH 1/1] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
  4 siblings, 0 replies; 10+ messages in thread
From: David Bremner @ 2014-01-13 18:37 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

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

> When naming test scripts in format 'T\d\d\d-name.sh' the list of
> tests to run are created dynamically. This makes test

series pushed.

d

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

* [PATCH 1/1] test: check that expected results file exists when test script exits != 0
  2014-01-09 15:18 [PATCH 1/2] test: basic: drop 'ensure all available tests are run' Tomi Ollila
                   ` (2 preceding siblings ...)
  2014-01-13 18:37 ` David Bremner
@ 2014-01-13 19:25 ` Tomi Ollila
  2014-01-13 20:38 ` [PATCH 1/1] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
  4 siblings, 0 replies; 10+ messages in thread
From: Tomi Ollila @ 2014-01-13 19:25 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

This way tests continue to run after one test script does not
report success.
---

I failed to notice this when MANUALLY testing the test change in question.

This is quick fix and makes notmuch-test & test-lib.sh have interdependency
how to modify the test script name for output file. I'll think whether
there is something to be made about this, meanwhile I'm open to suggestions
to that. too.

 test/notmuch-test | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/notmuch-test b/test/notmuch-test
index b843712..ecf81a9 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -32,12 +32,14 @@ fi
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
 for test in $TESTS; do
+    this_test=${test%.sh}
+    this_test=${this_test#T[0-9][0-9][0-9]-}
     $TEST_TIMEOUT_CMD ./$test "$@" &
     wait $!
     # If the test failed without producing results, then it aborted,
     # so we should abort, too.
     RES=$?
-    if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then
+    if [[ $RES != 0 && ! -e "test-results/$this_test" ]]; then
         exit $RES
     fi
 done
-- 
1.8.0

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

* [PATCH 1/1] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare
  2014-01-09 15:18 [PATCH 1/2] test: basic: drop 'ensure all available tests are run' Tomi Ollila
                   ` (3 preceding siblings ...)
  2014-01-13 19:25 ` [PATCH 1/1] test: check that expected results file exists when test script exits != 0 Tomi Ollila
@ 2014-01-13 20:38 ` Tomi Ollila
  2014-01-15  0:29   ` David Bremner
  4 siblings, 1 reply; 10+ messages in thread
From: Tomi Ollila @ 2014-01-13 20:38 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

Script `notmuch-test` expects the results file have T\d\d\d- part
intact so the results files (and some test output files) are now named
as such.

The T\d\d\d- part is dropped in new variable $this_test_bare which is used
in progress informational messages and when loading .el files in emacs
tests (whenever $this_test_bare.el exists).
---

This is an alternative to

id:1389641156-3365-1-git-send-email-tomi.ollila@iki.fi

I think this is better.

 test/test-lib.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 487075e..78af170 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -27,7 +27,7 @@ shopt -u xpg_echo
 
 this_test=${0##*/}
 this_test=${this_test%.sh}
-this_test=${this_test#T[0-9][0-9][0-9]-}
+this_test_bare=${this_test#T[0-9][0-9][0-9]-}
 
 # if --tee was passed, write the output not only to the terminal, but
 # additionally to the file test-results/$BASENAME.out, too.
@@ -196,7 +196,7 @@ print_test_description ()
 {
 	test -z "$test_description_printed" || return 0
 	echo
-	echo $this_test: "Testing ${test_description}"
+	echo $this_test_bare: "Testing ${test_description}"
 	test_description_printed=1
 }
 if [ -z "$NOTMUCH_TEST_QUIET" ]
@@ -1085,7 +1085,7 @@ test_emacs () {
 	test -z "$missing_dependencies" || return
 
 	if [ -z "$EMACS_SERVER" ]; then
-		emacs_tests="${this_test}.el"
+		emacs_tests="${this_test_bare}.el"
 		if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then
 			load_emacs_tests="--eval '(load \"$emacs_tests\")'"
 		else
-- 
1.8.4.2

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

* Re: [PATCH 1/1] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare
  2014-01-13 20:38 ` [PATCH 1/1] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
@ 2014-01-15  0:29   ` David Bremner
  2014-01-15 18:58     ` [PATCH 1/1] test: check that expected results file exists when test script exits != 0 Tomi Ollila
  2014-01-15 19:02     ` [PATCH v2] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
  0 siblings, 2 replies; 10+ messages in thread
From: David Bremner @ 2014-01-15  0:29 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

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

> Script `notmuch-test` expects the results file have T\d\d\d- part
> intact so the results files (and some test output files) are now named
> as such.
>
> The T\d\d\d- part is dropped in new variable $this_test_bare which is used
> in progress informational messages and when loading .el files in emacs
> tests (whenever $this_test_bare.el exists).

Should this commit message mention the bug it fixes?

Other than that the patch looks ok.

d

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

* [PATCH 1/1] test: check that expected results file exists when test script exits != 0
  2014-01-15  0:29   ` David Bremner
@ 2014-01-15 18:58     ` Tomi Ollila
  2014-01-15 19:02     ` [PATCH v2] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
  1 sibling, 0 replies; 10+ messages in thread
From: Tomi Ollila @ 2014-01-15 18:58 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

This way tests continue to run after one test script does not
report success.
---

I failed to notice this when MANUALLY testing the test change in question.

This is quick fix and makes notmuch-test & test-lib.sh have interdependency
how to modify the test script name for output file. I'll think whether
there is something to be made about this, meanwhile I'm open to suggestions
to that. too.

 test/notmuch-test | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/notmuch-test b/test/notmuch-test
index b843712..ecf81a9 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -32,12 +32,14 @@ fi
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
 for test in $TESTS; do
+    this_test=${test%.sh}
+    this_test=${this_test#T[0-9][0-9][0-9]-}
     $TEST_TIMEOUT_CMD ./$test "$@" &
     wait $!
     # If the test failed without producing results, then it aborted,
     # so we should abort, too.
     RES=$?
-    if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then
+    if [[ $RES != 0 && ! -e "test-results/$this_test" ]]; then
         exit $RES
     fi
 done
-- 
1.8.0

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

* [PATCH v2] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare
  2014-01-15  0:29   ` David Bremner
  2014-01-15 18:58     ` [PATCH 1/1] test: check that expected results file exists when test script exits != 0 Tomi Ollila
@ 2014-01-15 19:02     ` Tomi Ollila
  2014-01-19  0:06       ` David Bremner
  1 sibling, 1 reply; 10+ messages in thread
From: Tomi Ollila @ 2014-01-15 19:02 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

Script `notmuch-test` expects the results file have T\d\d\d- part
intact so the results files (and some test output files) are now
name as such.
Without this change `notmuch-test` will exit in case the test
script it was executing exited with nonzero value.

The T\d\d\d- part is dropped in new variable $this_test_bare which is
used in progress informational messages and when loading .el files in
emacs tests (whenever $this_test_bare.el exists).
---

This is v2 of id:1389645491-7600-1-git-send-email-tomi.ollila@iki.fi

Ignore id:1389812307-17065-1-git-send-email-tomi.ollila@iki.fi ,
i sent wrong patch file :/.

 test/test-lib.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 487075e..78af170 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -27,7 +27,7 @@ shopt -u xpg_echo
 
 this_test=${0##*/}
 this_test=${this_test%.sh}
-this_test=${this_test#T[0-9][0-9][0-9]-}
+this_test_bare=${this_test#T[0-9][0-9][0-9]-}
 
 # if --tee was passed, write the output not only to the terminal, but
 # additionally to the file test-results/$BASENAME.out, too.
@@ -196,7 +196,7 @@ print_test_description ()
 {
 	test -z "$test_description_printed" || return 0
 	echo
-	echo $this_test: "Testing ${test_description}"
+	echo $this_test_bare: "Testing ${test_description}"
 	test_description_printed=1
 }
 if [ -z "$NOTMUCH_TEST_QUIET" ]
@@ -1085,7 +1085,7 @@ test_emacs () {
 	test -z "$missing_dependencies" || return
 
 	if [ -z "$EMACS_SERVER" ]; then
-		emacs_tests="${this_test}.el"
+		emacs_tests="${this_test_bare}.el"
 		if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then
 			load_emacs_tests="--eval '(load \"$emacs_tests\")'"
 		else
-- 
1.8.4.2

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

* Re: [PATCH v2] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare
  2014-01-15 19:02     ` [PATCH v2] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
@ 2014-01-19  0:06       ` David Bremner
  0 siblings, 0 replies; 10+ messages in thread
From: David Bremner @ 2014-01-19  0:06 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

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

> Script `notmuch-test` expects the results file have T\d\d\d- part
> intact so the results files (and some test output files) are now
> name as such.
> Without this change `notmuch-test` will exit in case the test
> script it was executing exited with nonzero value.
>
> The T\d\d\d- part is dropped in new variable $this_test_bare which is
> used in progress informational messages and when loading .el files in
> emacs tests (whenever $this_test_bare.el exists).

pushed, 

d

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

end of thread, other threads:[~2014-01-19  0:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 15:18 [PATCH 1/2] test: basic: drop 'ensure all available tests are run' Tomi Ollila
2014-01-09 15:18 ` [PATCH 2/2] test: renamed test scripts to format T\d\d\d-name.sh Tomi Ollila
2014-01-12  0:28 ` [PATCH 1/2] test: basic: drop 'ensure all available tests are run' David Bremner
2014-01-13 18:37 ` David Bremner
2014-01-13 19:25 ` [PATCH 1/1] test: check that expected results file exists when test script exits != 0 Tomi Ollila
2014-01-13 20:38 ` [PATCH 1/1] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
2014-01-15  0:29   ` David Bremner
2014-01-15 18:58     ` [PATCH 1/1] test: check that expected results file exists when test script exits != 0 Tomi Ollila
2014-01-15 19:02     ` [PATCH v2] test: leave T\d\d\d- in variable $this_test and introduce $this_test_bare Tomi Ollila
2014-01-19  0:06       ` 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).