tests: workaround old gawk versions that do not provide @include support

Some of our tests use GNU awk @include extension, but not all currently
used versions of GNU awk support it.  Skip these tests if gawk does not
provide @include support.

* tests/init.sh (check_gawk): New function.
(match_awk): Use it.
diff --git a/tests/init.sh b/tests/init.sh
index 0c5b121..c976806 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -59,6 +59,18 @@
 	rm -f -- "$LOG".[0-9]*
 }
 
+check_gawk()
+{
+	check_prog gawk
+	check_prog grep
+
+	local program="$1"; shift
+	if grep '^@include[[:space:]]' < "$program" > /dev/null; then
+		gawk '@include "/dev/null"' < /dev/null ||
+			framework_skip_ 'gawk does not support @include'
+	fi
+}
+
 # Usage: [FILE_TO_CHECK [AWK_PROGRAM [ERROR_MESSAGE [EXTRA_AWK_OPTIONS...]]]]
 # Check whether all patterns listed in AWK_PROGRAM
 # match FILE_TO_CHECK using egrep.
@@ -83,7 +95,7 @@
 		error="$1"; shift
 	fi
 
-	check_prog gawk
+	check_gawk "$program"
 
 	AWKPATH="$srcdir" gawk -f "$program" "$@" < "$output" || {
 		cat < "$output"