* [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
@ 2010-12-01 20:27 Joel Borggrén-Franck
2010-12-02 15:13 ` Ruben Pollan
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Joel Borggrén-Franck @ 2010-12-01 20:27 UTC (permalink / raw)
To: notmuch
From: Joel Borggrén-Franck <jbf@codehouse.se>
Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
systems running on bash < 4 can prepend bash >= 4 to path before
running the tests.
---
test/README | 6 +++---
test/aggregate-results.sh | 2 +-
test/author-order | 2 +-
test/basic | 2 +-
test/dump-restore | 2 +-
test/emacs | 2 +-
test/encoding | 2 +-
test/from-guessing | 2 +-
test/json | 2 +-
test/long-id | 2 +-
test/maildir-sync | 2 +-
test/new | 2 +-
test/notmuch-test | 2 +-
test/raw | 2 +-
test/reply | 2 +-
test/search | 2 +-
test/search-output | 2 +-
test/test-lib.sh | 2 +-
test/test-verbose | 2 +-
test/thread-naming | 2 +-
test/thread-order | 2 +-
test/uuencode | 2 +-
test/valgrind/valgrind.sh | 2 +-
23 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/test/README b/test/README
index ebaa3cf..07da480 100644
--- a/test/README
+++ b/test/README
@@ -68,11 +68,11 @@ remaining tests to be unaffected.
Writing Tests
-------------
-The test script is written as a shell script. It should start
-with the standard "#!/bin/bash" with copyright notices, and an
+The test script is written as a shell script. It should start with
+the standard "#!/usr/bin/env bash" with copyright notices, and an
assignment to variable 'test_description', like this:
- #!/bin/bash
+ #!/usr/bin/env bash
#
# Copyright (c) 2005 Junio C Hamano
#
diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh
index 0f1ea33..732d6ca 100755
--- a/test/aggregate-results.sh
+++ b/test/aggregate-results.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
fixed=0
success=0
diff --git a/test/author-order b/test/author-order
index 9f0b931..2d79873 100755
--- a/test/author-order
+++ b/test/author-order
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="author reordering;"
. ./test-lib.sh
diff --git a/test/basic b/test/basic
index 309779c..e20e994 100755
--- a/test/basic
+++ b/test/basic
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Copyright (c) 2005 Junio C Hamano
#
diff --git a/test/dump-restore b/test/dump-restore
index 0d78f01..a4de370 100755
--- a/test/dump-restore
+++ b/test/dump-restore
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="\"notmuch dump\" and \"notmuch restore\""
. ./test-lib.sh
diff --git a/test/emacs b/test/emacs
index 75dec89..baa6f3d 100755
--- a/test/emacs
+++ b/test/emacs
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="emacs interface"
. test-lib.sh
diff --git a/test/encoding b/test/encoding
index 68cb8ee..673b039 100755
--- a/test/encoding
+++ b/test/encoding
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="encoding issues"
. ./test-lib.sh
diff --git a/test/from-guessing b/test/from-guessing
index 6744e68..d8727bb 100755
--- a/test/from-guessing
+++ b/test/from-guessing
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="From line heuristics (with multiple configured addresses)"
. ./test-lib.sh
diff --git a/test/json b/test/json
index 7fe2a27..1978f8b 100755
--- a/test/json
+++ b/test/json
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="--format=json output"
. ./test-lib.sh
diff --git a/test/long-id b/test/long-id
index 84f9294..85e620f 100755
--- a/test/long-id
+++ b/test/long-id
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="messages with ridiculously-long message IDs"
. ./test-lib.sh
diff --git a/test/maildir-sync b/test/maildir-sync
index 50a5b8e..2b43127 100755
--- a/test/maildir-sync
+++ b/test/maildir-sync
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="maildir synchronization"
diff --git a/test/new b/test/new
index 7b396ae..1b7296e 100755
--- a/test/new
+++ b/test/new
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description='"notmuch new" in several variations'
. ./test-lib.sh
diff --git a/test/notmuch-test b/test/notmuch-test
index 43565e8..d753c81 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Run tests
#
diff --git a/test/raw b/test/raw
index 4ed237c..b7e265a 100755
--- a/test/raw
+++ b/test/raw
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr//bin/env bash
test_description='notmuch show --format=raw'
. ./test-lib.sh
diff --git a/test/reply b/test/reply
index 99c3376..c0b8e26 100755
--- a/test/reply
+++ b/test/reply
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="\"notmuch reply\" in several variations"
. ./test-lib.sh
diff --git a/test/search b/test/search
index b180c7f..2085fe6 100755
--- a/test/search
+++ b/test/search
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description='"notmuch search" in several variations'
. ./test-lib.sh
diff --git a/test/search-output b/test/search-output
index b414993..ef870bf 100755
--- a/test/search-output
+++ b/test/search-output
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description='various settings for "notmuch search --output="'
. ./test-lib.sh
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 04a4c14..89c9a4c 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Copyright (c) 2005 Junio C Hamano
#
diff --git a/test/test-verbose b/test/test-verbose
index f29a9c7..4100c05 100755
--- a/test/test-verbose
+++ b/test/test-verbose
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description='the verbosity options of the test framework itself.'
diff --git a/test/thread-naming b/test/thread-naming
index bcc3d61..41b97d9 100755
--- a/test/thread-naming
+++ b/test/thread-naming
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="naming of threads with changing subject"
. ./test-lib.sh
diff --git a/test/thread-order b/test/thread-order
index 1819fce..6c3a4b3 100755
--- a/test/thread-order
+++ b/test/thread-order
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="threading when messages received out of order"
. ./test-lib.sh
diff --git a/test/uuencode b/test/uuencode
index d509320..d0d16bd 100755
--- a/test/uuencode
+++ b/test/uuencode
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
test_description="handling of uuencoded data"
. ./test-lib.sh
diff --git a/test/valgrind/valgrind.sh b/test/valgrind/valgrind.sh
index 3bc90f5..78700c0 100755
--- a/test/valgrind/valgrind.sh
+++ b/test/valgrind/valgrind.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
base=$(basename "$0")
--
1.7.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
2010-12-01 20:27 [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability Joel Borggrén-Franck
@ 2010-12-02 15:13 ` Ruben Pollan
2010-12-02 16:33 ` Joel Borggrén-Franck
2010-12-02 16:38 ` Mike Kelly
2011-05-27 21:04 ` Carl Worth
2 siblings, 1 reply; 5+ messages in thread
From: Ruben Pollan @ 2010-12-02 15:13 UTC (permalink / raw)
To: notmuch
[-- Attachment #1: Type: text/plain, Size: 696 bytes --]
On 21:27, Wed 01 Dec 10, Joel Borggrén-Franck wrote:
> From: Joel Borggrén-Franck <jbf@codehouse.se>
>
> Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
> systems running on bash < 4 can prepend bash >= 4 to path before
> running the tests.
Is there any reason to use bash? Is the test system dependent to any key feature
of bash?
Not every system has bash installed. To have a dependency on bash just for
development I think is not a big issue. But if it don't requires any big effort
I think will be better to have it more generic.
--
Rubén Pollán | jabber:meskio@jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Nos vamos a Croatan.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
2010-12-02 15:13 ` Ruben Pollan
@ 2010-12-02 16:33 ` Joel Borggrén-Franck
0 siblings, 0 replies; 5+ messages in thread
From: Joel Borggrén-Franck @ 2010-12-02 16:33 UTC (permalink / raw)
Cc: notmuch
On Thu, Dec 2, 2010 at 4:13 PM, Ruben Pollan <meskio@sindominio.net> wrote:
> On 21:27, Wed 01 Dec 10, Joel Borggrén-Franck wrote:
>> From: Joel Borggrén-Franck <jbf@codehouse.se>
>>
>> Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
>> systems running on bash < 4 can prepend bash >= 4 to path before
>> running the tests.
>
> Is there any reason to use bash? Is the test system dependent to any key feature
> of bash?
>
> Not every system has bash installed. To have a dependency on bash just for
> development I think is not a big issue. But if it don't requires any big effort
> I think will be better to have it more generic.
>
The test harness explicitly requires bash >= 4 . The docs say it needs
support for associative arrays.
cheers
/Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
2010-12-01 20:27 [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability Joel Borggrén-Franck
2010-12-02 15:13 ` Ruben Pollan
@ 2010-12-02 16:38 ` Mike Kelly
2011-05-27 21:04 ` Carl Worth
2 siblings, 0 replies; 5+ messages in thread
From: Mike Kelly @ 2010-12-02 16:38 UTC (permalink / raw)
To: notmuch
On Wed, Dec 01, 2010 at 09:27:52PM +0100, Joel Borggrén-Franck wrote:
> From: Joel Borggrén-Franck <jbf@codehouse.se>
>
> Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
> systems running on bash < 4 can prepend bash >= 4 to path before
> running the tests.
This is also important on systems where bash isn't in /bin/ (for
example, FreeBSD), so I'd appreciate this patch. (I'm slowly working on
various other patches that are required to get things working well on
FreeBSD).
--
Mike Kelly
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
2010-12-01 20:27 [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability Joel Borggrén-Franck
2010-12-02 15:13 ` Ruben Pollan
2010-12-02 16:38 ` Mike Kelly
@ 2011-05-27 21:04 ` Carl Worth
2 siblings, 0 replies; 5+ messages in thread
From: Carl Worth @ 2011-05-27 21:04 UTC (permalink / raw)
To: Joel Borggrén-Franck, notmuch
[-- Attachment #1: Type: text/plain, Size: 484 bytes --]
On Wed, 1 Dec 2010 21:27:52 +0100, Joel Borggrén-Franck <joel.borggren.franck@gmail.com> wrote:
> From: Joel Borggrén-Franck <jbf@codehouse.se>
>
> Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
> systems running on bash < 4 can prepend bash >= 4 to path before
> running the tests.
Thanks for the patch, Joel!
This issue recently came up again on IRC, so I dug out this patch,
applied, and pushed it.
-Carl
--
carl.d.worth@intel.com
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-27 21:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 20:27 [PATCH] test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability Joel Borggrén-Franck
2010-12-02 15:13 ` Ruben Pollan
2010-12-02 16:33 ` Joel Borggrén-Franck
2010-12-02 16:38 ` Mike Kelly
2011-05-27 21:04 ` Carl Worth
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).