1## Process this fill with automake to generate Makefile.in
2#
3#   Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
4#   Free Software Foundation, Inc.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
20AUTOMAKE_OPTIONS = dejagnu
21
22# These will get executed and parsed for test output
23SANE_AS3TESTS = \
24	basic.as \
25	class.as \
26	lookup.as \
27	function.as \
28	MovieClip.as \
29	Sprite.as \
30	QName.as \
31	System.as \
32	Keyboard.as \
33	Object.as \
34	$(NULL)
35
36BOGUS_AS3TESTS = \
37	$(NULL)
38
39AS3TESTS=$(SANE_AS3TESTS) $(BOGUS_AS3TESTS)
40
41EXTRA_DIST = $(AS3TESTS) dejagnu.as
42
43abs_mediadir = `cd $(srcdir)/../media; pwd`
44
45# AS3COMPILE set by configure.
46AS3COMPILE_FLAGS =
47AS3COMPILE_CPP = $(CPP) -x c -P -I$(srcdir) -DMEDIADIR="$(abs_mediadir)"
48
49SANE_AS3TESTS_OUT = $(SANE_AS3TESTS:.as=.swf)
50BOGUS_AS3TESTS_OUT = $(BOGUS_AS3TESTS:.as=.swf)
51AS3TESTS_OUT = $(SANE_AS3TESTS_OUT) $(BOGUS_AS3TESTS_OUT)
52
53TEST_DRIVERS = ../simple.exp
54TEST_CASES = \
55	sanetests-runner \
56	bogustests-runner \
57	$(check_PROGRAMS)
58
59sanetests-runner: $(srcdir)/../generic-testrunner.sh $(SANE_AS3TESTS_OUT) Makefile
60	sh $(srcdir)/../generic-testrunner.sh -c "__END_OF_TEST__" -r 50 $(top_builddir) $(SANE_AS3TESTS_OUT) > $@
61	chmod 755 $@
62
63bogustests-runner: $(srcdir)/../generic-testrunner.sh $(BOGUS_AS3TESTS_OUT) Makefile
64	sh $(srcdir)/../generic-testrunner.sh -C __END_OF_TEST__ -r 50 $(top_builddir) $(BOGUS_AS3TESTS_OUT) > $@
65	chmod 755 $@
66
67$(AS3TESTS_OUT): dejagnu.as check.as
68
69SUFFIXES = .as .swf
70.as.swf:
71	$(AS3COMPILE_CPP) $< > $(@:%.swf=pp_%.as)
72	$(AS3COMPILE) $(AS3COMPILE_FLAGS) -o $@ $(@:%.swf=pp_%.as)
73
74CLEANFILES =  \
75	$(TEST_CASES) \
76	gnash-dbg.log \
77	site.exp.bak \
78	alltests-runner \
79	testrun.* \
80	*.swf \
81	*.pp \
82	pp_*.as \
83	*_testrunner \
84	*_Runner
85
86check-DEJAGNU: site-update $(TEST_CASES)
87	@runtest=$(RUNTEST); \
88	if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
89	    GNASH_GC_TRIGGER_THRESHOLD=0 GNASHRC=../gnashrc $$runtest $(RUNTESTFLAGS) $(TEST_DRIVERS); true; \
90	else \
91	  echo "WARNING: could not find \`runtest'" 1>&2; \
92          for i in "$(TEST_CASES)"; do \
93	    GNASH_GC_TRIGGER_THRESHOLD=0  GNASHRC=../gnashrc $(SHELL) $$i; \
94	  done; \
95	fi
96
97site-update: site.exp
98	@rm -fr site.exp.bak
99	@cp site.exp site.exp.bak
100	@sed -e '/testcases/d' site.exp.bak > site.exp
101	@echo "# This is a list of the pre-compiled testcases" >> site.exp
102	@echo "set testcases \"$(TEST_CASES)\"" >> site.exp
103
104