-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_print.sh
28 lines (23 loc) · 955 Bytes
/
test_print.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
dp0="$(dirname $(readlink -m $BASH_SOURCE))"
EXEC="$dp0/build/txtrtool"
[ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ] || [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ] && EXEC="$EXEC.exe"
[ -n "$1" ] && [ -d "$1" ] && indir="$1" || indir="$dp0/.local/testing"
function test-start {
echo "________________________________________________________________________________"
echo "$1"
}
function test-end {
if [ $1 -ne 0 ]; then echo "__________________ ERROR: returned non-zero status of $1 __________________" ; fi
echo "________________________________________________________________________________"
}
[ -n "$IFS" ] && OLDIFS="$IFS"
IFS=$'\n'
for F in `find "$indir" -maxdepth 1 -type f -name "*.TXTR"`; do
if [ -n "$F" ] && [ -f "$F" ] ; then
test-start "\"$EXEC\" print \"$F\""
"$EXEC" print "$F"
test-end $?
fi
done
[ -n "$OLDIFS" ] && IFS="$OLDIFS" || unset IFS