mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
f8f94ab329
At the same time, update the expected test output to match the current tools output, and write diff and ref files in /tmp.
32 lines
667 B
Bash
Executable File
32 lines
667 B
Bash
Executable File
#! /bin/bash
|
|
|
|
GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk-builder-tool}
|
|
TEST_DATA_DIR=${TEST_DATA_DIR:-./simplify-data}
|
|
TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}
|
|
|
|
shopt -s nullglob
|
|
TESTS=( "$TEST_DATA_DIR"/*.ui )
|
|
|
|
echo "1..${#TESTS}"
|
|
|
|
I=1
|
|
for t in ${TESTS[*]}; do
|
|
name=$(basename $t .ui)
|
|
expected="$TEST_DATA_DIR/$name.expected"
|
|
result="$TEST_RESULT_DIR/$name.out"
|
|
diff="$TEST_RESULT_DIR/$name.diff"
|
|
ref="$TEST_RESULT_DIR/$name.ref"
|
|
|
|
$GTK_BUILDER_TOOL simplify $t 2>/dev/null >$result
|
|
|
|
if diff -u "$expected" "$result" > "$diff"; then
|
|
echo "ok $I $name"
|
|
rm "$diff"
|
|
else
|
|
echo "not ok $I $name"
|
|
cp "$expected" "$ref"
|
|
fi
|
|
|
|
I=$((I+1))
|
|
done
|