Revert a buildsystem change that affected our installed-tests patch
authorJeremy Bicha <jeremy.bicha@canonical.com>
Mon, 5 Jun 2023 17:49:03 +0000 (13:49 -0400)
committerJeremy Bicha <jeremy.bicha@canonical.com>
Mon, 5 Jun 2023 19:04:04 +0000 (15:04 -0400)
debian/patches/Revert-tests-Stop-copying-the-tool-tests.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/Revert-tests-Stop-copying-the-tool-tests.patch b/debian/patches/Revert-tests-Stop-copying-the-tool-tests.patch
new file mode 100644 (file)
index 0000000..a5da614
--- /dev/null
@@ -0,0 +1,397 @@
+From: Jeremy Bicha <jeremy.bicha@canonical.com>
+Date: Mon, 5 Jun 2023 13:49:20 -0400
+Subject: Revert "tests: Stop copying the tool tests"
+
+This reverts commit bb3a6214cbeaa3211be007192e536bd473323836.
+
+This is actually used by the installed tests
+which we also had to revert dropping (in a separate patch)
+---
+ testsuite/tools/meson.build      |  8 +++++--
+ testsuite/tools/settings         | 20 -----------------
+ testsuite/tools/settings.in      | 20 +++++++++++++++++
+ testsuite/tools/simplify         | 47 ----------------------------------------
+ testsuite/tools/simplify-3to4    | 47 ----------------------------------------
+ testsuite/tools/simplify-3to4.in | 47 ++++++++++++++++++++++++++++++++++++++++
+ testsuite/tools/simplify.in      | 47 ++++++++++++++++++++++++++++++++++++++++
+ testsuite/tools/validate         | 37 -------------------------------
+ testsuite/tools/validate.in      | 37 +++++++++++++++++++++++++++++++
+ 9 files changed, 157 insertions(+), 153 deletions(-)
+ delete mode 100755 testsuite/tools/settings
+ create mode 100755 testsuite/tools/settings.in
+ delete mode 100755 testsuite/tools/simplify
+ delete mode 100755 testsuite/tools/simplify-3to4
+ create mode 100755 testsuite/tools/simplify-3to4.in
+ create mode 100755 testsuite/tools/simplify.in
+ delete mode 100755 testsuite/tools/validate
+ create mode 100755 testsuite/tools/validate.in
+
+diff --git a/testsuite/tools/meson.build b/testsuite/tools/meson.build
+index 96ac7fd..986c2d6 100644
+--- a/testsuite/tools/meson.build
++++ b/testsuite/tools/meson.build
+@@ -3,8 +3,12 @@ if bash.found()
+   test_env = environment()
+   foreach t : ['simplify', 'simplify-3to4', 'validate', 'settings']
+-    test(t,
+-      find_program(t, dirs: meson.current_source_dir()),
++    configure_file(output: t,
++      input: '@0@.in'.format(t),
++      copy: true,
++    )
++    test(t, bash,
++      args: t,
+       workdir: meson.current_build_dir(),
+       protocol: 'tap',
+       env: [
+diff --git a/testsuite/tools/settings b/testsuite/tools/settings
+deleted file mode 100755
+index 3c5ce69..0000000
+--- a/testsuite/tools/settings
++++ /dev/null
+@@ -1,20 +0,0 @@
+-#! /bin/bash
+-
+-GTK_QUERY_SETTINGS=${GTK_QUERY_SETTINGS:-gtk4-query-settings}
+-TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}
+-
+-shopt -s nullglob
+-
+-echo "1..1"
+-
+-name=gtk-query-settings
+-result=$TEST_RESULT_DIR/$name.out
+-$GTK_QUERY_SETTINGS 2>/dev/null >$result
+-EXPECTED=50
+-SEEN=$(wc -l $result | cut -f1 -d' ')
+-
+-if [ $SEEN -eq $EXPECTED ]; then
+-  echo "ok 1 $name."
+-else
+-  echo "not ok 1 $name. Expected: $EXPECTED. Seen: $SEEN"
+-fi
+diff --git a/testsuite/tools/settings.in b/testsuite/tools/settings.in
+new file mode 100755
+index 0000000..3c5ce69
+--- /dev/null
++++ b/testsuite/tools/settings.in
+@@ -0,0 +1,20 @@
++#! /bin/bash
++
++GTK_QUERY_SETTINGS=${GTK_QUERY_SETTINGS:-gtk4-query-settings}
++TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}
++
++shopt -s nullglob
++
++echo "1..1"
++
++name=gtk-query-settings
++result=$TEST_RESULT_DIR/$name.out
++$GTK_QUERY_SETTINGS 2>/dev/null >$result
++EXPECTED=50
++SEEN=$(wc -l $result | cut -f1 -d' ')
++
++if [ $SEEN -eq $EXPECTED ]; then
++  echo "ok 1 $name."
++else
++  echo "not ok 1 $name. Expected: $EXPECTED. Seen: $SEEN"
++fi
+diff --git a/testsuite/tools/simplify b/testsuite/tools/simplify
+deleted file mode 100755
+index 12b4cea..0000000
+--- a/testsuite/tools/simplify
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#! /bin/bash
+-
+-GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool}
+-TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/simplify-data
+-TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}/simplify
+-
+-mkdir -p "$TEST_RESULT_DIR"
+-
+-shopt -s nullglob
+-TESTS=( "$TEST_DATA_DIR"/*.ui )
+-
+-echo "1..$((2 * ${#TESTS[*]}))"
+-
+-I=1
+-for t in ${TESTS[*]}; do
+-  name=$(basename $t .ui)
+-  expected="$TEST_DATA_DIR/$name.expected"
+-  result="$TEST_RESULT_DIR/$name.out"
+-  result2="$TEST_RESULT_DIR/$name.out2"
+-  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))
+-
+-  cp $t $result2
+-  $GTK_BUILDER_TOOL simplify --replace $result2 2>/dev/null
+-
+-  if diff -u "$expected" "$result2" > "$diff"; then
+-    echo "ok $I $name (--replace)"
+-    rm "$diff"
+-  else
+-    echo "not ok $I $name (--replace)"
+-    cp "$expected" "$ref"
+-  fi
+-
+-  I=$((I+1))
+-done
+diff --git a/testsuite/tools/simplify-3to4 b/testsuite/tools/simplify-3to4
+deleted file mode 100755
+index 0a97f1a..0000000
+--- a/testsuite/tools/simplify-3to4
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#! /bin/bash
+-
+-GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool}
+-TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/simplify-data-3to4
+-TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}/simplify-3to4
+-
+-mkdir -p "$TEST_RESULT_DIR"
+-
+-shopt -s nullglob
+-TESTS=( "$TEST_DATA_DIR"/*.ui )
+-
+-echo "1..$((2 * ${#TESTS[*]}))"
+-
+-I=1
+-for t in ${TESTS[*]}; do
+-  name=$(basename $t .ui)
+-  expected="$TEST_DATA_DIR/$name.expected"
+-  result="$TEST_RESULT_DIR/$name.out"
+-  result2="$TEST_RESULT_DIR/$name.out2"
+-  diff="$TEST_RESULT_DIR/$name.diff"
+-  ref="$TEST_RESULT_DIR/$name.ref"
+-
+-  $GTK_BUILDER_TOOL simplify --3to4 $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))
+-
+-  cp $t $result2
+-  $GTK_BUILDER_TOOL simplify --3to4 --replace $result2 2>/dev/null
+-
+-  if diff -u "$expected" "$result2" > "$diff"; then
+-    echo "ok $I $name (--replace)"
+-    rm "$diff"
+-  else
+-    echo "not ok $I $name (--replace)"
+-    cp "$expected" "$ref"
+-  fi
+-
+-  I=$((I+1))
+-done
+diff --git a/testsuite/tools/simplify-3to4.in b/testsuite/tools/simplify-3to4.in
+new file mode 100755
+index 0000000..0a97f1a
+--- /dev/null
++++ b/testsuite/tools/simplify-3to4.in
+@@ -0,0 +1,47 @@
++#! /bin/bash
++
++GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool}
++TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/simplify-data-3to4
++TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}/simplify-3to4
++
++mkdir -p "$TEST_RESULT_DIR"
++
++shopt -s nullglob
++TESTS=( "$TEST_DATA_DIR"/*.ui )
++
++echo "1..$((2 * ${#TESTS[*]}))"
++
++I=1
++for t in ${TESTS[*]}; do
++  name=$(basename $t .ui)
++  expected="$TEST_DATA_DIR/$name.expected"
++  result="$TEST_RESULT_DIR/$name.out"
++  result2="$TEST_RESULT_DIR/$name.out2"
++  diff="$TEST_RESULT_DIR/$name.diff"
++  ref="$TEST_RESULT_DIR/$name.ref"
++
++  $GTK_BUILDER_TOOL simplify --3to4 $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))
++
++  cp $t $result2
++  $GTK_BUILDER_TOOL simplify --3to4 --replace $result2 2>/dev/null
++
++  if diff -u "$expected" "$result2" > "$diff"; then
++    echo "ok $I $name (--replace)"
++    rm "$diff"
++  else
++    echo "not ok $I $name (--replace)"
++    cp "$expected" "$ref"
++  fi
++
++  I=$((I+1))
++done
+diff --git a/testsuite/tools/simplify.in b/testsuite/tools/simplify.in
+new file mode 100755
+index 0000000..12b4cea
+--- /dev/null
++++ b/testsuite/tools/simplify.in
+@@ -0,0 +1,47 @@
++#! /bin/bash
++
++GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool}
++TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/simplify-data
++TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}/simplify
++
++mkdir -p "$TEST_RESULT_DIR"
++
++shopt -s nullglob
++TESTS=( "$TEST_DATA_DIR"/*.ui )
++
++echo "1..$((2 * ${#TESTS[*]}))"
++
++I=1
++for t in ${TESTS[*]}; do
++  name=$(basename $t .ui)
++  expected="$TEST_DATA_DIR/$name.expected"
++  result="$TEST_RESULT_DIR/$name.out"
++  result2="$TEST_RESULT_DIR/$name.out2"
++  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))
++
++  cp $t $result2
++  $GTK_BUILDER_TOOL simplify --replace $result2 2>/dev/null
++
++  if diff -u "$expected" "$result2" > "$diff"; then
++    echo "ok $I $name (--replace)"
++    rm "$diff"
++  else
++    echo "not ok $I $name (--replace)"
++    cp "$expected" "$ref"
++  fi
++
++  I=$((I+1))
++done
+diff --git a/testsuite/tools/validate b/testsuite/tools/validate
+deleted file mode 100755
+index 42048ef..0000000
+--- a/testsuite/tools/validate
++++ /dev/null
+@@ -1,37 +0,0 @@
+-#! /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 $(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
+diff --git a/testsuite/tools/validate.in b/testsuite/tools/validate.in
+new file mode 100755
+index 0000000..42048ef
+--- /dev/null
++++ b/testsuite/tools/validate.in
+@@ -0,0 +1,37 @@
++#! /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 $(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
index e715dfeee05aed40a9250249b6323812811a4f5d..fc3f33fb0d76ea8698de159b3104e3fa05671d71 100644 (file)
@@ -1,3 +1,4 @@
+Revert-tests-Stop-copying-the-tool-tests.patch
 Revert-build-Drop-the-install-tests-option.patch
 debian/reftest_compare_surfaces-Report-how-much-the-images-diffe.patch
 debian/reftests-Allow-minor-differences-to-be-tolerated.patch