1 # This file is part of Shapes.
3 # Shapes is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
8 # Shapes is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 # Copyright 2008, 2013 Gustaf Hendeby, Henrik Tidefelt
18 # === How to setup a new test ===
19 # Just add your .blank file and a corresponding .correct file, and add
20 # the test to the TESTS variable below. The .correct file should be
21 # the output expected on stdout, like this:
24 # If the test is expected to fail, simply add a .correct file such
25 # that a failing test will not be able to create it, for instance by
26 # copying the .correct file from another test. See below for how to
27 # indicate that a test is expected to fail.
29 # The following variable must be edited by hand to include every test
30 # that is expected to fail.
31 XFAIL_TESTS = test_bad
33 SHAPES = ${top_builddir}/source/shapes
34 SHAPESFLAGS = --warn=error --resources=no \
35 --fontmetricspath ${top_srcdir}/resources/fontmetrics \
36 --tmpdir "/tmp/shapes.${USER}" --tmp*=yes \
37 --needpath ${top_srcdir}/resources/extensions
39 TEST_BASE = $(notdir $(basename $(wildcard ${srcdir}/*.blank)))
41 # TESTS needs to be a literal listing of tests, make sure it agrees with
42 # test-list.test ${addprefix test_, ${TEST_BASE}}
43 # You can get the ${...} part in a terminal as
44 # ls *.blank | sed -e 's/\(.*\)\.blank/test_\1/' | tr '\n' ' '
45 TESTS = test-list.test \
46 test_bad test_dynamic test_scopes test_sort
48 check_DATA = ${addsuffix .out, ${TEST_BASE}} test-list.out
49 dist_check_DATA = testTEMPLATE \
50 ${addsuffix .blank, ${TEST_BASE}} \
51 ${addsuffix .correct, ${TEST_BASE}} \
53 CLEANFILES = ${addprefix test_, ${TEST_BASE}} \
54 ${addsuffix .out, ${TEST_BASE}} \
55 ${addsuffix .pdf, ${TEST_BASE}} \
56 ${addsuffix .log, ${TEST_BASE}} \
57 test-list.correct test-list.out
60 @sed -e 's/FNAME/$*/g' < $< > $@ && \
63 %.out : ${srcdir}/%.blank ${SHAPES}
64 -@$(SHAPES) ${SHAPESFLAGS} $< > $@ 2> /dev/null
66 %.test : testTEMPLATE %.correct
67 @sed -e 's/FNAME/$*/g' < $< > $@ && \
70 test-list.correct : Makefile
71 echo ${TESTS} | sed -e 's/test-list.test\( \)\{0,\}//g' | tr -s ' ' '\n' | sort > $@
74 (cd ${srcdir}; ls *.blank) | sed -e 's/\(.*\)\.blank/test_\1/' | sort > $@