From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: [dtc] Remove another bashism from run_tests.sh
Date: Mon, 30 Aug 2010 12:53:03 +1000 [thread overview]
Message-ID: <20100830025303.GA5210@yookeroo> (raw)
Current we check for various error codes with [ $x == "NN" ]. However
'==' is not actually a correct operator for the [ (test) command. It
should be either '=' for string comparison or '-eq' for integer
comparison. It appears that the bash builtin version of test
implements '==' though, so we were getting away with it, as long as
/bin/sh was bash - or the testsuite generated no errors.
This patch fixes the usage of test so that it should work on non-bash
shells.
Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Index: dtc/tests/run_tests.sh
===================================================================
--- dtc.orig/tests/run_tests.sh 2010-08-30 12:43:03.133784380 +1000
+++ dtc/tests/run_tests.sh 2010-08-30 12:43:34.741770203 +1000
@@ -24,11 +24,11 @@ base_run_test() {
tot_pass=$((tot_pass + 1))
else
ret="$?"
- if [ "$ret" == "1" ]; then
+ if [ "$ret" -eq 1 ]; then
tot_config=$((tot_config + 1))
- elif [ "$ret" == "2" ]; then
+ elif [ "$ret" -eq 2 ]; then
tot_fail=$((tot_fail + 1))
- elif [ "$ret" == "$VGCODE" ]; then
+ elif [ "$ret" -eq $VGCODE ]; then
tot_vg=$((tot_vg + 1))
else
tot_strange=$((tot_strange + 1))
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next reply other threads:[~2010-08-30 2:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-30 2:53 David Gibson [this message]
2010-08-30 3:22 ` [dtc] Remove another bashism from run_tests.sh Grant Likely
2010-09-20 14:33 ` Jon Loeliger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100830025303.GA5210@yookeroo \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=jdl-CYoMK+44s/E@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.