| 1 | ## Process this file with automake to create Makefile.in
|
|---|
| 2 | # Copyright 1997-1998, 2005-2021 Free Software Foundation, Inc.
|
|---|
| 3 | #
|
|---|
| 4 | # This program is free software; you can redistribute it and/or modify
|
|---|
| 5 | # it under the terms of the GNU General Public License as published by
|
|---|
| 6 | # the Free Software Foundation; either version 3, or (at your option)
|
|---|
| 7 | # any later version.
|
|---|
| 8 | #
|
|---|
| 9 | # This program is distributed in the hope that it will be useful,
|
|---|
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | # GNU General Public License for more details.
|
|---|
| 13 | #
|
|---|
| 14 | # You should have received a copy of the GNU General Public License
|
|---|
| 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|---|
| 16 |
|
|---|
| 17 | TEST_EXTENSIONS = .sh .pl
|
|---|
| 18 |
|
|---|
| 19 | if HAVE_PERL
|
|---|
| 20 | TESTSUITE_PERL = $(PERL)
|
|---|
| 21 | else
|
|---|
| 22 | TESTSUITE_PERL = $(SHELL) $(srcdir)/no-perl
|
|---|
| 23 | endif
|
|---|
| 24 |
|
|---|
| 25 | # Options passed to the perl invocations running the perl test scripts.
|
|---|
| 26 | TESTSUITE_PERL_OPTIONS = -w -I$(srcdir) -MCoreutils -MCuSkip
|
|---|
| 27 | # '$f' is set by the Automake-generated test harness to the path of the
|
|---|
| 28 | # current test script stripped of VPATH components, and is used by the
|
|---|
| 29 | # CuTmpdir module to determine the name of the temporary files to be
|
|---|
| 30 | # used. Note that $f is a shell variable, not a make macro, so the use
|
|---|
| 31 | # of '$$f' below is correct, and not a typo.
|
|---|
| 32 | TESTSUITE_PERL_OPTIONS += -M"CuTmpdir qw($$f)"
|
|---|
| 33 |
|
|---|
| 34 | SH_LOG_COMPILER = $(SHELL)
|
|---|
| 35 | PL_LOG_COMPILER = $(TESTSUITE_PERL) $(TESTSUITE_PERL_OPTIONS)
|
|---|
| 36 |
|
|---|
| 37 | check_PROGRAMS = get-mb-cur-max
|
|---|
| 38 | AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib \
|
|---|
| 39 | -I$(top_srcdir)/src
|
|---|
| 40 | AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
|
|---|
| 41 |
|
|---|
| 42 | # Tell the linker to omit references to unused shared libraries.
|
|---|
| 43 | AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
|
|---|
| 44 | LDADD = ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a
|
|---|
| 45 |
|
|---|
| 46 | # The triple-backref test is expected to fail with both the system
|
|---|
| 47 | # matcher (i.e., with glibc) and with the included matcher.
|
|---|
| 48 | # Both matchers need to be fixed.
|
|---|
| 49 | # FIXME-2015: Remove this once the glibc and gnulib bugs are fixed.
|
|---|
| 50 | XFAIL_TESTS = triple-backref
|
|---|
| 51 |
|
|---|
| 52 | # Equivalence classes are only supported when using the system
|
|---|
| 53 | # matcher (which means only with glibc).
|
|---|
| 54 | # The included matcher needs to be fixed.
|
|---|
| 55 | # FIXME-2015: Remove this once the gnulib bug is fixed.
|
|---|
| 56 | if USE_INCLUDED_REGEX
|
|---|
| 57 | XFAIL_TESTS += equiv-classes
|
|---|
| 58 | else
|
|---|
| 59 | # The backref-alt test fails for glibc 2.27 and earlier.
|
|---|
| 60 | # If you're using older glibc you can upgrade to glibc 2.28 or later,
|
|---|
| 61 | # configure --with-included-regex, or ignore the test failure.
|
|---|
| 62 | endif
|
|---|
| 63 |
|
|---|
| 64 | TESTS = \
|
|---|
| 65 | backref \
|
|---|
| 66 | backref-alt \
|
|---|
| 67 | backref-multibyte-slow \
|
|---|
| 68 | backref-word \
|
|---|
| 69 | backslash-dot \
|
|---|
| 70 | backslash-s-and-repetition-operators \
|
|---|
| 71 | backslash-s-vs-invalid-multibyte \
|
|---|
| 72 | big-hole \
|
|---|
| 73 | big-match \
|
|---|
| 74 | binary-file-matches \
|
|---|
| 75 | bogus-wctob \
|
|---|
| 76 | bre \
|
|---|
| 77 | c-locale \
|
|---|
| 78 | case-fold-backref \
|
|---|
| 79 | case-fold-backslash-w \
|
|---|
| 80 | case-fold-char-class \
|
|---|
| 81 | case-fold-char-range \
|
|---|
| 82 | case-fold-char-type \
|
|---|
| 83 | case-fold-titlecase \
|
|---|
| 84 | char-class-multibyte \
|
|---|
| 85 | char-class-multibyte2 \
|
|---|
| 86 | context-0 \
|
|---|
| 87 | count-newline \
|
|---|
| 88 | dfa-coverage \
|
|---|
| 89 | dfa-heap-overrun \
|
|---|
| 90 | dfa-infloop \
|
|---|
| 91 | dfa-invalid-utf8 \
|
|---|
| 92 | dfaexec-multibyte \
|
|---|
| 93 | empty \
|
|---|
| 94 | empty-line \
|
|---|
| 95 | empty-line-mb \
|
|---|
| 96 | encoding-error \
|
|---|
| 97 | epipe \
|
|---|
| 98 | equiv-classes \
|
|---|
| 99 | ere \
|
|---|
| 100 | euc-mb \
|
|---|
| 101 | false-match-mb-non-utf8 \
|
|---|
| 102 | fedora \
|
|---|
| 103 | fgrep-infloop \
|
|---|
| 104 | fgrep-longest \
|
|---|
| 105 | file \
|
|---|
| 106 | filename-lineno.pl \
|
|---|
| 107 | fmbtest \
|
|---|
| 108 | foad1 \
|
|---|
| 109 | grep-dev-null \
|
|---|
| 110 | grep-dev-null-out \
|
|---|
| 111 | grep-dir \
|
|---|
| 112 | hash-collision-perf \
|
|---|
| 113 | help-version \
|
|---|
| 114 | high-bit-range \
|
|---|
| 115 | in-eq-out-infloop \
|
|---|
| 116 | include-exclude \
|
|---|
| 117 | inconsistent-range \
|
|---|
| 118 | initial-tab \
|
|---|
| 119 | invalid-multibyte-infloop \
|
|---|
| 120 | khadafy \
|
|---|
| 121 | kwset-abuse \
|
|---|
| 122 | long-line-vs-2GiB-read \
|
|---|
| 123 | long-pattern-perf \
|
|---|
| 124 | many-regex-performance \
|
|---|
| 125 | match-lines \
|
|---|
| 126 | max-count-overread \
|
|---|
| 127 | max-count-vs-context \
|
|---|
| 128 | mb-dot-newline \
|
|---|
| 129 | mb-non-UTF8-overrun \
|
|---|
| 130 | mb-non-UTF8-perf-Fw \
|
|---|
| 131 | mb-non-UTF8-performance \
|
|---|
| 132 | mb-non-UTF8-word-boundary \
|
|---|
| 133 | multibyte-white-space \
|
|---|
| 134 | multiple-begin-or-end-line \
|
|---|
| 135 | null-byte \
|
|---|
| 136 | options \
|
|---|
| 137 | pcre \
|
|---|
| 138 | pcre-abort \
|
|---|
| 139 | pcre-context \
|
|---|
| 140 | pcre-count \
|
|---|
| 141 | pcre-infloop \
|
|---|
| 142 | pcre-invalid-utf8-infloop \
|
|---|
| 143 | pcre-invalid-utf8-input \
|
|---|
| 144 | pcre-jitstack \
|
|---|
| 145 | pcre-o \
|
|---|
| 146 | pcre-utf8 \
|
|---|
| 147 | pcre-w \
|
|---|
| 148 | pcre-wx-backref \
|
|---|
| 149 | pcre-z \
|
|---|
| 150 | posix-bracket \
|
|---|
| 151 | prefix-of-multibyte \
|
|---|
| 152 | proc \
|
|---|
| 153 | r-dot \
|
|---|
| 154 | repetition-overflow \
|
|---|
| 155 | reversed-range-endpoints \
|
|---|
| 156 | sjis-mb \
|
|---|
| 157 | skip-device \
|
|---|
| 158 | skip-read \
|
|---|
| 159 | spencer1 \
|
|---|
| 160 | spencer1-locale \
|
|---|
| 161 | stack-overflow \
|
|---|
| 162 | status \
|
|---|
| 163 | surrogate-pair \
|
|---|
| 164 | symlink \
|
|---|
| 165 | triple-backref \
|
|---|
| 166 | turkish-I \
|
|---|
| 167 | turkish-I-without-dot \
|
|---|
| 168 | turkish-eyes \
|
|---|
| 169 | two-chars \
|
|---|
| 170 | two-files \
|
|---|
| 171 | unibyte-binary \
|
|---|
| 172 | unibyte-bracket-expr \
|
|---|
| 173 | unibyte-negated-circumflex \
|
|---|
| 174 | utf8-bracket \
|
|---|
| 175 | warn-char-classes \
|
|---|
| 176 | word-delim-multibyte \
|
|---|
| 177 | word-multi-file \
|
|---|
| 178 | word-multibyte \
|
|---|
| 179 | write-error-msg \
|
|---|
| 180 | yesno \
|
|---|
| 181 | z-anchor-newline
|
|---|
| 182 |
|
|---|
| 183 | EXTRA_DIST = \
|
|---|
| 184 | $(TESTS) \
|
|---|
| 185 | bre.awk \
|
|---|
| 186 | bre.tests \
|
|---|
| 187 | Coreutils.pm \
|
|---|
| 188 | CuSkip.pm \
|
|---|
| 189 | CuTmpdir.pm \
|
|---|
| 190 | envvar-check \
|
|---|
| 191 | ere.awk \
|
|---|
| 192 | ere.tests \
|
|---|
| 193 | init.cfg \
|
|---|
| 194 | init.sh \
|
|---|
| 195 | khadafy.lines \
|
|---|
| 196 | khadafy.regexp \
|
|---|
| 197 | no-perl \
|
|---|
| 198 | spencer1.awk \
|
|---|
| 199 | spencer1.tests \
|
|---|
| 200 | spencer1-locale.awk
|
|---|
| 201 |
|
|---|
| 202 | # Default to a nonzero value. Environment overrides.
|
|---|
| 203 | # https://udrepper.livejournal.com/11429.html
|
|---|
| 204 | MALLOC_PERTURB_ = 1
|
|---|
| 205 |
|
|---|
| 206 | TESTS_ENVIRONMENT = \
|
|---|
| 207 | tmp__=$${TMPDIR-/tmp}; \
|
|---|
| 208 | test -d "$$tmp__" && test -w "$$tmp__" || tmp__=.; \
|
|---|
| 209 | . $(srcdir)/envvar-check; \
|
|---|
| 210 | TMPDIR=$$tmp__; export TMPDIR; \
|
|---|
| 211 | \
|
|---|
| 212 | if test -n "$$BASH_VERSION" || (eval "export v=x") 2>/dev/null; then \
|
|---|
| 213 | export_with_values () { export "$$@"; }; \
|
|---|
| 214 | else \
|
|---|
| 215 | export_with_values () \
|
|---|
| 216 | { \
|
|---|
| 217 | sed_extract_var='s/=.*//'; \
|
|---|
| 218 | sed_quote_value="s/'/'\\\\''/g;s/=\\(.*\\)/='\\1'/";\
|
|---|
| 219 | for arg in "$$@"; do \
|
|---|
| 220 | var=`echo "$$arg" | sed "$$sed_extract_var"`; \
|
|---|
| 221 | arg=`echo "$$arg" | sed "$$sed_quote_value"`; \
|
|---|
| 222 | eval "$$arg"; \
|
|---|
| 223 | export "$$var"; \
|
|---|
| 224 | done; \
|
|---|
| 225 | }; \
|
|---|
| 226 | fi; \
|
|---|
| 227 | \
|
|---|
| 228 | : 'Test egrep/fgrep help if they use our grep.'; \
|
|---|
| 229 | grep=`echo grep | sed -e '$(transform)'` || exit; \
|
|---|
| 230 | if test "$$grep" = grep; then \
|
|---|
| 231 | built_programs='grep egrep fgrep'; \
|
|---|
| 232 | else \
|
|---|
| 233 | built_programs='grep'; \
|
|---|
| 234 | fi; \
|
|---|
| 235 | \
|
|---|
| 236 | export_with_values \
|
|---|
| 237 | VERSION='$(VERSION)' \
|
|---|
| 238 | LOCALE_FR='$(LOCALE_FR)' \
|
|---|
| 239 | LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
|
|---|
| 240 | AWK=$(AWK) \
|
|---|
| 241 | LC_ALL=C \
|
|---|
| 242 | abs_top_builddir='$(abs_top_builddir)' \
|
|---|
| 243 | abs_top_srcdir='$(abs_top_srcdir)' \
|
|---|
| 244 | abs_srcdir='$(abs_srcdir)' \
|
|---|
| 245 | built_programs="$$built_programs" \
|
|---|
| 246 | host_triplet='$(host_triplet)' \
|
|---|
| 247 | srcdir='$(srcdir)' \
|
|---|
| 248 | top_srcdir='$(top_srcdir)' \
|
|---|
| 249 | CC='$(CC)' \
|
|---|
| 250 | GREP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
|
|---|
| 251 | MAKE=$(MAKE) \
|
|---|
| 252 | MALLOC_PERTURB_=$(MALLOC_PERTURB_) \
|
|---|
| 253 | PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
|
|---|
| 254 | PACKAGE_VERSION=$(PACKAGE_VERSION) \
|
|---|
| 255 | PERL='$(PERL)' \
|
|---|
| 256 | SHELL='$(SHELL)' \
|
|---|
| 257 | PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
|
|---|
| 258 | ; \
|
|---|
| 259 | \
|
|---|
| 260 | : 'set this envvar to indicate whether -P works'; \
|
|---|
| 261 | m=0; if err=`echo .|grep -Pq . 2>&1`; then \
|
|---|
| 262 | test -z "$$err" && m=1; fi; \
|
|---|
| 263 | export PCRE_WORKS=$$m; \
|
|---|
| 264 | 9>&2
|
|---|
| 265 |
|
|---|
| 266 | LOG_COMPILER = $(SHELL)
|
|---|
| 267 |
|
|---|
| 268 | VERBOSE = yes
|
|---|
| 269 |
|
|---|
| 270 | check: check_executable_TESTS
|
|---|
| 271 | .PHONY: check_executable_TESTS
|
|---|
| 272 | check_executable_TESTS: Makefile
|
|---|
| 273 | $(AM_V_GEN)fail=0; \
|
|---|
| 274 | cd $(srcdir) && for i in $(TESTS); do \
|
|---|
| 275 | test -x $$i || { fail=1; echo $$i >&2; }; \
|
|---|
| 276 | done; \
|
|---|
| 277 | test $$fail = 1 \
|
|---|
| 278 | && { echo the above test scripts are not executable >&2; exit 1; } \
|
|---|
| 279 | || :
|
|---|