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_ASTESTS = \
24	hello.as \
25	inheritance.as \
26	function_test.as \
27	enum.as \
28	exception.as \
29	levels.as \
30	implementsOpTest.as \
31	TextFieldTest.as \
32	super_test1.as \
33	$(NULL)
34# These ones are the ones for which consistency check fail
35BOGUS_ASTESTS = \
36	$(NULL)
37# This one is host container communication (ExternalInterface) test
38EXTCOMM_ASTESTS = \
39	extcomm.as \
40	$(NULL)
41
42ASTESTS = $(SANE_ASTESTS) $(BOGUS_ASTESTS) $(EXTCOMM_ASTESTS)
43
44
45# These will get compiled to SWFs just as above, but will not be executed as a test
46# They are for secondary movies to be loaded by the above tests.
47AUXMOVIES = \
48	    level5.as \
49	    level99.as \
50	    level87.as \
51	    $(NULL)
52
53EXTRA_DIST = $(ASTESTS) $(AUXMOVIES) TestClass.as Dejagnu.as check.as Derived1.as Base1.as  implementsOp/BExtendingImplementation.as  implementsOp/ImplementationA.as  implementsOp/ImplementationB.as implementsOp/SimpleInterface.as
54
55MTASC_FLAGS = -version 6 -cp $(MTASC_CLASSPATH) -cp $(srcdir) -v -header 800:600:20
56MTASCV8_FLAGS = -version 8 -cp $(MTASC_CLASSPATH) -cp $(srcdir) -v -header 800:600:20
57MTASC_CPP = $(CPP) -x c -P -I$(srcdir)
58
59SANE_ASTESTS_OUT = $(SANE_ASTESTS:.as=.swf)
60BOGUS_ASTESTS_OUT = $(BOGUS_ASTESTS:.as=.swf)
61EXTCOMM_ASTESTS_OUT = $(EXTCOMM_ASTESTS:.as=.swf)
62ASTESTS_OUT = $(SANE_ASTESTS_OUT) $(BOGUS_ASTESTS_OUT) $(EXTCOMM_ASTESTS_OUT)
63
64AUXMOVIES_OUT = $(AUXMOVIES:.as=.swf)
65
66$(ASTESTS_OUT) $(AUXMOVIES_OUT): Dejagnu.as check.as
67
68
69TEST_DRIVERS = ../simple.exp
70TEST_CASES = \
71	sanetests-runner \
72	bogustests-runner \
73	extcommtests-runner \
74	$(NULL)
75
76sanetests-runner: $(srcdir)/../generic-testrunner.sh $(SANE_ASTESTS_OUT) $(AUXMOVIES_OUT) Makefile
77	sh $(srcdir)/../generic-testrunner.sh -c __END_OF_TEST__ -r 50 -d 30 $(top_builddir) $(SANE_ASTESTS_OUT) > $@
78	chmod 755 $@
79
80bogustests-runner: $(srcdir)/../generic-testrunner.sh $(BOGUS_ASTESTS_OUT) $(AUXMOVIES_OUT) Makefile
81	sh $(srcdir)/../generic-testrunner.sh -C __END_OF_TEST__ -r 50 $(top_builddir) $(BOGUS_ASTESTS_OUT) > $@
82	chmod 755 $@
83
84extcommtests-runner: $(srcdir)/extcommtests-runner.sh $(EXTCOMM_ASTESTS_OUT) Makefile
85	sh $(srcdir)/extcommtests-runner.sh $(top_builddir) $(top_srcdir) $(EXTCOMM_ASTESTS_OUT) > $@
86	chmod 755 $@
87
88extcomm.swf: extcomm.as
89	$(MTASC_CPP) $< > $(@:%.swf=pp_%.as)
90	$(MTASC) $(MTASCV8_FLAGS) -swf $@ -main $(@:%.swf=pp_%.as)
91
92.as.swf:
93	$(MTASC_CPP) $< > $(@:%.swf=pp_%.as)
94	$(MTASC) $(MTASC_FLAGS) -swf $@ -main $(@:%.swf=pp_%.as)
95
96CLEANFILES =  \
97	gnash-dbg.log \
98	site.exp.bak \
99	*-runner \
100	testrun.* \
101	*.swf \
102	*.pp \
103	pp_*.as \
104	*_testrunner \
105	*_Runner
106
107check-DEJAGNU: site-update $(TEST_CASES)
108	@runtest=$(RUNTEST); \
109	if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
110	    GNASH_GC_TRIGGER_THRESHOLD=0  GNASHRC=../gnashrc $$runtest $(RUNTESTFLAGS) $(TEST_DRIVERS); true; \
111	else \
112	  echo "WARNING: could not find \`runtest'" 1>&2; \
113          for i in "$(TEST_CASES)"; do \
114	    GNASH_GC_TRIGGER_THRESHOLD=0  GNASHRC=../gnashrc $(SHELL) $$i; \
115	  done; \
116	fi
117
118site-update: site.exp
119	@rm -fr site.exp.bak
120	@cp site.exp site.exp.bak
121	@sed -e '/testcases/d' site.exp.bak > site.exp
122	@echo "# This is a list of the pre-compiled testcases" >> site.exp
123	@echo "set testcases \"$(TEST_CASES)\"" >> site.exp
124
125