qlexer.l: rewrite not to need static var, at_eof.
[iwhd.git] / t / Makefile.am
blobc2a0af6ad70b95932b8f9837ffa64fd1c5c04d45
1 ## Process this file with automake to create Makefile.in
2 # Copyright 2010 Red Hat, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 TESTS =                                         \
18   basic                                         \
19   replication                                   \
20   parser-test                                   \
21   auto
23 EXTRA_DIST =                                    \
24   $(TESTS)                                      \
25   init.cfg                                      \
26   init.sh
28 check_PROGRAMS = parser
30 BUILT_SOURCES =
31 BUILT_SOURCES += parser.c
32 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
33 parser_CPPFLAGS = -I $(top_srcdir)
35 parser.c: Makefile.am
36         rm -f $@-t $@
37         printf '#define PARSER_UNIT_TEST 1\n' > $@-t
38         printf '#include "iwhd-qparser.c"\n' >> $@-t
39         chmod a=r $@-t
40         mv $@-t $@
42 TESTS_ENVIRONMENT =                             \
43   tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
44   TMPDIR=$$tmp__; export TMPDIR;                \
45   exec 9>&2;                                    \
46   shell_or_perl_() {                            \
47     if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                 \
48       if $(PERL) -e 'use warnings' > /dev/null 2>&1; then               \
49         grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
50         $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                          \
51               -M"CuTmpdir qw($$f)" -- "$$1";    \
52       else                                      \
53         echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
54           "so skipping this test";              \
55         (exit 77);                              \
56       fi;                                       \
57     else                                        \
58       $(SHELL) "$$1";                           \
59     fi;                                         \
60   };                                            \
61   export                                        \
62   LC_ALL=C                                      \
63   VERSION=$(VERSION)                            \
64   abs_top_builddir='$(abs_top_builddir)'        \
65   abs_top_srcdir='$(abs_top_srcdir)'            \
66   abs_srcdir='$(abs_srcdir)'                    \
67   built_programs='$(built_programs)'            \
68   srcdir='$(srcdir)'                            \
69   top_srcdir='$(top_srcdir)'                    \
70   CC='$(CC)'                                    \
71   IWHD_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
72   MALLOC_PERTURB_=$(MALLOC_PERTURB_); export MALLOC_PERTURB_ \
73   PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'      \
74   PACKAGE_VERSION=$(PACKAGE_VERSION)            \
75   PERL='$(PERL)'                                \
76   SHELL='$(SHELL)'                              \
77   PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
78   ; shell_or_perl_