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.
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.
error="$1"; shift
fi
- check_prog gawk
+ check_gawk "$program"
AWKPATH="$srcdir" gawk -f "$program" "$@" < "$output" || {
cat < "$output"