diff options
author | umarcor <unai.martinezcorral@ehu.eus> | 2021-01-18 17:51:19 +0100 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2021-01-19 07:40:40 +0100 |
commit | b15ba54b9f1de3a5c71d3e221b2ced4c13916530 (patch) | |
tree | 54584b8b29c6f45621cf1437c079e6c354000e87 /testsuite | |
parent | 58186fa3774292a384a1a2b57ce965fd0e947544 (diff) | |
download | ghdl-b15ba54b9f1de3a5c71d3e221b2ced4c13916530.tar.gz ghdl-b15ba54b9f1de3a5c71d3e221b2ced4c13916530.tar.bz2 ghdl-b15ba54b9f1de3a5c71d3e221b2ced4c13916530.zip |
testsuite: address bash linting issues
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/testsuite.sh | 2 | ||||
-rwxr-xr-x | testsuite/sanity/testsuite.sh | 2 | ||||
-rwxr-xr-x | testsuite/suite_driver.sh | 18 | ||||
-rwxr-xr-x | testsuite/synth/testsuite.sh | 2 | ||||
-rwxr-xr-x | testsuite/testsuite.sh | 10 | ||||
-rwxr-xr-x | testsuite/vpi/testsuite.sh | 2 |
6 files changed, 18 insertions, 18 deletions
diff --git a/testsuite/gna/testsuite.sh b/testsuite/gna/testsuite.sh index ebf84842b..10f965de6 100644 --- a/testsuite/gna/testsuite.sh +++ b/testsuite/gna/testsuite.sh @@ -2,4 +2,4 @@ set -e -`dirname $0`/../suite_driver.sh gna $@ +$(dirname "$0")/../suite_driver.sh gna $@ diff --git a/testsuite/sanity/testsuite.sh b/testsuite/sanity/testsuite.sh index 54d265d37..524e3fcad 100755 --- a/testsuite/sanity/testsuite.sh +++ b/testsuite/sanity/testsuite.sh @@ -2,4 +2,4 @@ set -e -`dirname $0`/../suite_driver.sh sanity $@ +$(dirname "$0")/../suite_driver.sh sanity $@ diff --git a/testsuite/suite_driver.sh b/testsuite/suite_driver.sh index 748961634..66a584a86 100755 --- a/testsuite/suite_driver.sh +++ b/testsuite/suite_driver.sh @@ -22,13 +22,13 @@ full=n for opt; do case "$opt" in -k | --keep-going) full=y ;; - --dir=*) dirs=`echo $opt | sed -e 's/--dir=//'` ;; - --skip=*) d=`echo $opt | sed -e 's/--skip=//'` - dirs=`echo "" $dirs | sed -e "s/ $d//"` ;; - --start-at=*) d=`echo $opt | sed -e 's/--start-at=//'` - dirs=`echo "" $dirs | sed -e "s/^.* $d//"` + --dir=*) dirs="$(echo "$opt" | sed -e 's/--dir=//')" ;; + --skip=*) d="$(echo "$opt" | sed -e 's/--skip=//')" + dirs="$(echo "" "$dirs" | sed -e "s/ $d//")" ;; + --start-at=*) d="$(echo "$opt" | sed -e 's/--start-at=//')" + dirs="$(echo "" "$dirs" | sed -e "s/^.* $d//")" dirs="$d $dirs" ;; - --list-tests) echo $dirs; exit 0;; + --list-tests) echo "$dirs"; exit 0;; *) echo "Unknown option $opt" exit 2 ;; @@ -36,14 +36,14 @@ for opt; do done singlerun() { - cd $1 + cd "$1" if ./testsuite.sh > test.log 2>&1 ; then printf "$_suite $1: ${ANSI_GREEN}ok${ANSI_NOCOLOR}\n" # Don't disp log else printf "$_suite $1: ${ANSI_RED}failed${ANSI_NOCOLOR}\n" cat test.log - if [ $2 = "y" ]; then + if [ x"$2" = x"y" ]; then failures="$failures $1" else exit 1; @@ -52,7 +52,7 @@ singlerun() { cd .. } -for i in $dirs; do singlerun $i $full; done +for i in $dirs; do singlerun "$i" "$full"; done if [ x"$failures" = x"" ]; then echo "$_suite tests are successful" && exit 0 diff --git a/testsuite/synth/testsuite.sh b/testsuite/synth/testsuite.sh index 76e3a7a32..08ed7f9db 100755 --- a/testsuite/synth/testsuite.sh +++ b/testsuite/synth/testsuite.sh @@ -2,4 +2,4 @@ set -e -`dirname $0`/../suite_driver.sh synth $@ +$(dirname "$0")/../suite_driver.sh synth $@ diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh index d24fa884d..68bf05a68 100755 --- a/testsuite/testsuite.sh +++ b/testsuite/testsuite.sh @@ -120,7 +120,7 @@ if [ "x$GHDL" = "x" ]; then fi fi -cd $(dirname $0) +cd $(dirname "$0") rm -f test_ok failures="" tests= @@ -144,7 +144,7 @@ do_test() { case $1 in sanity|gna|synth|vpi) gstart "[GHDL - test] $1" - cd $1 + cd "$1" ../suite_driver.sh $@ cd .. gend @@ -169,15 +169,15 @@ do_test() { gstart "GHDL is: $GHDL" $GHDL version -echo "REF: `$GHDL version ref`" -echo "HASH: `$GHDL version hash`" +echo "REF: $($GHDL version ref)" +echo "HASH: $($GHDL version hash)" gend gstart "GHDL help" $GHDL help gend -for t in $tests; do do_test $t; done +for t in $tests; do do_test "$t"; done printf "${ANSI_GREEN}[GHDL - test] SUCCESSFUL${ANSI_NOCOLOR}\n" touch test_ok diff --git a/testsuite/vpi/testsuite.sh b/testsuite/vpi/testsuite.sh index ec4b5655e..5b9b7b301 100755 --- a/testsuite/vpi/testsuite.sh +++ b/testsuite/vpi/testsuite.sh @@ -2,4 +2,4 @@ set -e -`dirname $0`/../suite_driver.sh vpi $@ +$(dirname "$0")/../suite_driver.sh vpi $@ |