]> code.ossystems Code Review - openembedded-core.git/commitdiff
run-ptest: fix bashism
authorRobert Yang <liezhi.yang@windriver.com>
Wed, 27 Aug 2014 15:57:10 +0000 (08:57 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 Aug 2014 14:11:11 +0000 (15:11 +0100)
These script use /bin/sh as the interpreter, but contains bashism:
    recipes-devtools/insserv/files/run-ptest
    recipes-devtools/quilt/quilt/run-ptest
    recipes-devtools/tcltk/tcl/run-ptest
    recipes-extended/gawk/gawk-4.1.1/run-ptest
    recipes-support/beecrypt/beecrypt/run-ptest

Fixed:
    "==" -> "=" (should be -eq when integer)
    "&>log" -> ">log 2>&1"

And quilt's test scripts requires bash, add bash to RDEPENDS_quilt-ptest

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/insserv/files/run-ptest
meta/recipes-devtools/quilt/quilt-0.63.inc
meta/recipes-devtools/quilt/quilt/run-ptest
meta/recipes-devtools/tcltk/tcl/run-ptest
meta/recipes-extended/gawk/gawk-4.1.1/run-ptest
meta/recipes-support/beecrypt/beecrypt/run-ptest

index 495d1551c2f3d937b3ce1b386092f45c4d4fb45f..4a6da3030aeddcc1eaf4681f60797074667912b3 100644 (file)
@@ -11,7 +11,7 @@ output() {
 }
 
 for i in test_simple_sequence test_undetected_loop; \
-  do $i &>/dev/null ; output; \
+  do $i >/dev/null 2>&1; output; \
 done
 
 rm -rf ${tmpdir}
index f3757859ff7dce3c374c038006b5ac5d58e11620..433d6b40898103c34b70e74fc10a5617a0f97a12 100644 (file)
@@ -55,5 +55,5 @@ do_install_ptest() {
 RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
                         perl-module-filehandle perl-module-getopt-std \
                         perl-module-posix perl-module-file-temp \
-                        perl-module-text-parsewords \
+                        perl-module-text-parsewords bash \
 "
index 1ea0dae12850a3b05c3f1522d2e6476e89c8e616..958a9df5b61eea6f2e277f6e7ef7519d5e184986 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 ln -sf /bin/ed /usr/bin/ed
-for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? == 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
+for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
 rm -f /usr/bin/ed
index a5d6548d2a9e358da1610e851419d2c8d1696efd..dadba655f2aa34c07cd5f60ab88d54607ff1e430 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/sh
 
 for i in `ls tests/*.test |awk -F/ '{print $2}'`; \
-    do TCL_LIBRARY=library ./tcltest tests/all.tcl -file $i &>$i.tmp; \
+    do TCL_LIBRARY=library ./tcltest tests/all.tcl -file $i >$i.tmp 2>&1; \
     grep -q "^Files with failing tests:" $i.tmp; \
-    if [ $? == 0 ]; then echo "FAIL: $i"; \
+    if [ $? -eq 0 ]; then echo "FAIL: $i"; \
     else echo "PASS: $i"; rm -f $i.tmp; fi; \
 done
index 7d214eafbec1a11ff67451a34a9f18dc175bd2e0..d23f0bf6d7717697f3cf543b229048b1f7804315 100644 (file)
@@ -3,8 +3,8 @@
 cd test
 for i in `grep -vE "@|^$|#|Gt-dummy" Maketests |awk -F: '{print $1}'`; \
   do LC_ALL=${GAWKLOCALE:-C} LANG=${GAWKLOCALE:-C} srcdir=`pwd` AWK=gawk CMP=cmp \
-  make -f Maketests $i &>$i.tmp; \
+  make -f Maketests $i >$i.tmp 2>&1; \
   grep -q "Error" $i.tmp; \
-  if [ $? == 0 ]; then echo "FAIL: $i"; \
+  if [ $? -eq 0 ]; then echo "FAIL: $i"; \
   else echo "PASS: $i"; rm -f $i.tmp; fi; \
 done
index 5bc7460be995c868a42f0b53f0d97c6df20bc5bb..2ee294d991f8390ec423f958f092827fa04b7e2c 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 cd tests
-for i in `ls`; do ./$i; if [ $? == 0 ]; then echo "PASS: $i"; \
+for i in `ls`; do ./$i; if [ $? -eq 0 ]; then echo "PASS: $i"; \
     else echo "FAIL: $i"; fi; done