summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-02-08 18:10:51 -0500
committerMike Frysinger <vapier@gentoo.org>2021-02-08 18:10:51 -0500
commitc75db8d0825ff816cb05e9e46b7017b03a6b100d (patch)
tree3b60b6a54c0e8eee532457e358ff81929a970888 /windows
parente1f02d2833a7de496e4c148206f421cd664f0d56 (diff)
downloadlibgd-c75db8d0825ff816cb05e9e46b7017b03a6b100d.tar.gz
scripts: clean up various shellcheck warnings
Should hopefully not break anything :).
Diffstat (limited to 'windows')
-rwxr-xr-xwindows/msys/run_tests.sh57
1 files changed, 29 insertions, 28 deletions
diff --git a/windows/msys/run_tests.sh b/windows/msys/run_tests.sh
index f7c4b44..0856d96 100755
--- a/windows/msys/run_tests.sh
+++ b/windows/msys/run_tests.sh
@@ -13,14 +13,15 @@ CFLAGS="-g -Igdtest/ -I. -I../src/ -D_WIN32 -DHAVE_SYS_STAT_H $CFLAGS_EXTRA"
LDFLAGS='-L../src -llibgd'
DLLPATH=../src:$DLLPATH_EXTRA
-function run_gcc {
- if msg=`gcc $* 2>&1`; then
- true
- else
- echo "COMMAND: gcc $*" >> $LOG
- echo $msg >> $LOG
- false
- fi
+run_gcc() {
+ local msg
+ if msg=$(gcc "$@" 2>&1); then
+ true
+ else
+ echo "COMMAND: gcc $*" >> "${LOG}"
+ echo "${msg}" >> "${LOG}"
+ false
+ fi
}
# Switch to the working directory
@@ -29,7 +30,7 @@ cd ../../tests
# Initial setup
echo "Setting up..."
-[ -f $LOG ] && rm -f $LOG
+rm -f "${LOG}"
[ -f test_config.h ] || echo '#define GDTEST_TOP_DIR "."' > test_config.h
run_gcc -c $CFLAGS gdtest/gdtest.c
@@ -38,27 +39,27 @@ echo "Running tests:"
count=0
failures=0
compile_failures=0
-for test in `find . -name \*.c | grep -vE '^./(fontconfig|gdtest|gdhelpers|xpm)'`; do
- count=`expr $count + 1`
+for test in $(find . -name '*.c' | grep -vE '^./(fontconfig|gdtest|gdhelpers|xpm)'); do
+ : $(( count += 1 ))
- exe=${test%.c}.exe
- if run_gcc -o $exe $CFLAGS $LDFLAGS $test gdtest.o; then
- true;
- else
- echo "COMPILE_FAIL: $test"
- compile_failures=`expr $compile_failures + 1`
- continue
- fi
+ exe=${test%.c}.exe
+ if run_gcc -o "${exe}" ${CFLAGS} ${LDFLAGS} "${test}" gdtest.o; then
+ true
+ else
+ echo "COMPILE_FAIL: $test"
+ : $(( compile_failures += 1 ))
+ continue
+ fi
- echo "Running $exe:" >> $LOG
- if $exe 2>&1 >> $LOG; then
- echo "PASS: $test"
- else
- failures=`expr $failures + 1`
- echo "FAIL: $test"
- fi
- echo >> $LOG
+ echo "Running $exe:" >> "${LOG}"
+ if $exe >> "${LOG}" 2>&1; then
+ echo "PASS: $test"
+ else
+ : $(( failures += 1 ))
+ echo "FAIL: $test"
+ fi
+ echo >> "${LOG}"
done
echo "$failures failures and $compile_failures compile failures out of $count tests."
-echo "Error messages in $LOG"
+echo "Error messages in ${LOG}"