tests: Stop copying the tool tests
authorMatthias Clasen <mclasen@redhat.com>
Wed, 10 May 2023 01:21:39 +0000 (21:21 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 10 May 2023 01:21:39 +0000 (21:21 -0400)
No point in doing that, and the meson feature
we are using here is deprecated.

testsuite/tools/meson.build
testsuite/tools/settings [new file with mode: 0755]
testsuite/tools/settings.in [deleted file]
testsuite/tools/simplify [new file with mode: 0755]
testsuite/tools/simplify-3to4 [new file with mode: 0755]
testsuite/tools/simplify-3to4.in [deleted file]
testsuite/tools/simplify.in [deleted file]
testsuite/tools/validate [new file with mode: 0755]
testsuite/tools/validate.in [deleted file]

index 986c2d6dcc94b35b4d39bf33db1a23dac9b8528b..96ac7fda060d14c695c24c8c12d783afe71a4e90 100644 (file)
@@ -3,12 +3,8 @@ if bash.found()
   test_env = environment()
 
   foreach t : ['simplify', 'simplify-3to4', 'validate', 'settings']
-    configure_file(output: t,
-      input: '@0@.in'.format(t),
-      copy: true,
-    )
-    test(t, bash,
-      args: t,
+    test(t,
+      find_program(t, dirs: meson.current_source_dir()),
       workdir: meson.current_build_dir(),
       protocol: 'tap',
       env: [
diff --git a/testsuite/tools/settings b/testsuite/tools/settings
new file mode 100755 (executable)
index 0000000..3c5ce69
--- /dev/null
@@ -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/settings.in b/testsuite/tools/settings.in
deleted file mode 100755 (executable)
index 3c5ce69..0000000
+++ /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/simplify b/testsuite/tools/simplify
new file mode 100755 (executable)
index 0000000..12b4cea
--- /dev/null
@@ -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/simplify-3to4 b/testsuite/tools/simplify-3to4
new file mode 100755 (executable)
index 0000000..0a97f1a
--- /dev/null
@@ -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-3to4.in b/testsuite/tools/simplify-3to4.in
deleted file mode 100755 (executable)
index 0a97f1a..0000000
+++ /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.in b/testsuite/tools/simplify.in
deleted file mode 100755 (executable)
index 12b4cea..0000000
+++ /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/validate b/testsuite/tools/validate
new file mode 100755 (executable)
index 0000000..42048ef
--- /dev/null
@@ -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
diff --git a/testsuite/tools/validate.in b/testsuite/tools/validate.in
deleted file mode 100755 (executable)
index 42048ef..0000000
+++ /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