gtk/testsuite/tools/validate
Matthias Clasen 8c92c619de Test the deprecation support
Test gtk4-builder-tool validate --deprecations
2023-05-12 19:52:42 -04:00

38 lines
760 B
Bash
Executable File

#! /bin/bash
GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool}
TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/validate-data
TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}/validate
mkdir -p "$TEST_RESULT_DIR"
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"
cd $TEST_DATA_DIR
$GTK_BUILDER_TOOL validate --deprecations $(basename $t) 2>$result
cd $OLDPWD
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