[Crosstoolchain-logs] [device-tree-compiler] 153/198: tests: convert `echo -n` to `printf`

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:07:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.

commit 8b927bf3b80de4b0a49e6b6e4a56293e9baec364
Author: Mike Frysinger <vapier at chromium.org>
Date:   Sun May 24 21:57:32 2015 -0400

    tests: convert `echo -n` to `printf`
    
    The -n option is not standard in POSIX, so convert to printf which should
    work the same in every shell.
    
    Signed-off-by: Mike Frysinger <vapier at chromium.org>
---
 tests/run_tests.sh | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index c870432..dc214fd 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -42,20 +42,20 @@ base_run_test() {
 
 shorten_echo () {
     limit=32
-    echo -n "$1"
+    printf "$1"
     shift
     for x; do
 	if [ ${#x} -le $limit ]; then
-	    echo -n " $x"
+	    printf " $x"
 	else
 	    short=$(echo "$x" | head -c$limit)
-	    echo -n " \"$short\"...<${#x} bytes>"
+	    printf " \"$short\"...<${#x} bytes>"
 	fi
     done
 }
 
 run_test () {
-    echo -n "$@:	"
+    printf "$*:	"
     if [ -n "$VALGRIND" -a -f $1.supp ]; then
 	VGSUPP="--suppressions=$1.supp"
     fi
@@ -63,7 +63,7 @@ run_test () {
 }
 
 run_sh_test () {
-    echo -n "$@:	"
+    printf "$*:	"
     base_run_test sh "$@"
 }
 
@@ -106,12 +106,12 @@ wrap_error () {
 
 run_wrap_error_test () {
     shorten_echo "$@"
-    echo -n " {!= 0}:	"
+    printf " {!= 0}:	"
     base_run_test wrap_error "$@"
 }
 
 run_dtc_test () {
-    echo -n "dtc $@:	"
+    printf "dtc $*:	"
     base_run_test wrap_test $VALGRIND $DTC "$@"
 }
 
@@ -126,7 +126,7 @@ asm_to_so_test () {
 run_fdtget_test () {
     expect="$1"
     shift
-    echo -n "fdtget-runtest.sh "$expect" $@:	"
+    printf "fdtget-runtest.sh %s $*:	" "$(echo $expect)"
     base_run_test sh fdtget-runtest.sh "$expect" "$@"
 }
 
@@ -134,14 +134,14 @@ run_fdtput_test () {
     expect="$1"
     shift
     shorten_echo fdtput-runtest.sh "$expect" "$@"
-    echo -n ":	"
+    printf ":	"
     base_run_test sh fdtput-runtest.sh "$expect" "$@"
 }
 
 run_fdtdump_test() {
     file="$1"
     shorten_echo fdtdump-runtest.sh "$file"
-    echo -n ":	"
+    printf ":	"
     base_run_test sh fdtdump-runtest.sh "$file"
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list