2015-09-20 16:17:12 +00:00
|
|
|
#! /bin/bash
|
2015-05-02 21:21:31 +00:00
|
|
|
|
2019-11-29 14:51:35 +00:00
|
|
|
GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool}
|
2017-10-18 02:41:57 +00:00
|
|
|
TEST_DATA_DIR=${TEST_DATA_DIR:-./simplify-data}
|
2015-05-02 21:21:31 +00:00
|
|
|
TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}
|
|
|
|
|
|
|
|
shopt -s nullglob
|
|
|
|
TESTS=( "$TEST_DATA_DIR"/*.ui )
|
|
|
|
|
2019-05-05 15:21:58 +00:00
|
|
|
echo "1..${#TESTS[*]}"
|
2015-05-02 21:21:31 +00:00
|
|
|
|
|
|
|
I=1
|
|
|
|
for t in ${TESTS[*]}; do
|
|
|
|
name=$(basename $t .ui)
|
|
|
|
expected="$TEST_DATA_DIR/$name.expected"
|
|
|
|
result="$TEST_RESULT_DIR/$name.out"
|
2017-10-18 02:41:57 +00:00
|
|
|
diff="$TEST_RESULT_DIR/$name.diff"
|
|
|
|
ref="$TEST_RESULT_DIR/$name.ref"
|
2015-05-02 21:21:31 +00:00
|
|
|
|
|
|
|
$GTK_BUILDER_TOOL simplify $t 2>/dev/null >$result
|
|
|
|
|
2017-10-18 02:41:57 +00:00
|
|
|
if diff -u "$expected" "$result" > "$diff"; then
|
2015-05-02 21:21:31 +00:00
|
|
|
echo "ok $I $name"
|
2017-10-18 02:41:57 +00:00
|
|
|
rm "$diff"
|
2015-05-02 21:21:31 +00:00
|
|
|
else
|
|
|
|
echo "not ok $I $name"
|
2017-10-18 02:41:57 +00:00
|
|
|
cp "$expected" "$ref"
|
2015-05-02 21:21:31 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
I=$((I+1))
|
|
|
|
done
|