xref: /freebsd/contrib/libxo/tests/xo/Makefile.am (revision a0ee8cc636cd5c2374ec44ca71226564ea0bca95)
1#
2# $Id$
3#
4# Copyright 2014, Juniper Networks, Inc.
5# All rights reserved.
6# This SOFTWARE is licensed under the LICENSE provided in the
7# ../Copyright file. By downloading, installing, copying, or otherwise
8# using the SOFTWARE, you agree to be bound by the terms of that
9# LICENSE.
10
11AM_CFLAGS = -I${top_srcdir} -I${top_srcdir}/libxo
12
13# Ick: maintained by hand!
14TEST_CASES = \
15xo_01.sh
16
17X=\
18xo_02.sh \
19xo_03.sh \
20xo_04.sh \
21xo_05.sh \
22xo_06.sh
23
24# TEST_CASES := $(shell cd ${srcdir} ; echo *.c )
25
26EXTRA_DIST = \
27    ${TEST_CASES} \
28    ${addprefix saved/, ${TEST_CASES:.sh=.T.err}} \
29    ${addprefix saved/, ${TEST_CASES:.sh=.T.out}} \
30    ${addprefix saved/, ${TEST_CASES:.sh=.XP.err}} \
31    ${addprefix saved/, ${TEST_CASES:.sh=.XP.out}} \
32    ${addprefix saved/, ${TEST_CASES:.sh=.JP.err}} \
33    ${addprefix saved/, ${TEST_CASES:.sh=.JP.out}} \
34    ${addprefix saved/, ${TEST_CASES:.sh=.HP.err}} \
35    ${addprefix saved/, ${TEST_CASES:.sh=.HP.out}} \
36    ${addprefix saved/, ${TEST_CASES:.sh=.X.err}} \
37    ${addprefix saved/, ${TEST_CASES:.sh=.X.out}} \
38    ${addprefix saved/, ${TEST_CASES:.sh=.J.err}} \
39    ${addprefix saved/, ${TEST_CASES:.sh=.J.out}} \
40    ${addprefix saved/, ${TEST_CASES:.sh=.H.err}} \
41    ${addprefix saved/, ${TEST_CASES:.sh=.H.out}} \
42    ${addprefix saved/, ${TEST_CASES:.sh=.HIPx.err}} \
43    ${addprefix saved/, ${TEST_CASES:.sh=.HIPx.out}}
44
45S2O = | ${SED} '1,/@@/d'
46
47all:
48
49#TEST_TRACE = set -x ;
50
51XO=../../xo/xo
52
53TEST_ONE = \
54  LIBXO_OPTIONS=:W$$fmt \
55      ${CHECKER} sh ${srcdir}/$$base.sh ${XO} ${TEST_OPTS} \
56      > out/$$base.$$fmt.out 2> out/$$base.$$fmt.err ; \
57 ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.out out/$$base.$$fmt.out ${S2O} ; \
58 ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.err out/$$base.$$fmt.err ${S2O}
59
60TEST_FORMATS = T XP JP HP X J H HIPx
61
62test tests: ${bin_PROGRAMS}
63	@${MKDIR} -p out
64	-@ ${TEST_TRACE} (for test in ${TEST_CASES} ; do \
65	    base=`${BASENAME} $$test .sh` ; \
66            (for fmt in ${TEST_FORMATS}; do \
67	        echo "... $$test ... $$fmt ..."; \
68	        ${TEST_ONE}; \
69                true; \
70            done) \
71	done)
72
73one:
74	-@(test=${TEST_CASE}; data=${TEST_DATA}; ${TEST_ONE} ; true)
75
76accept:
77	-@(for test in ${TEST_CASES} ; do \
78	    base=`${BASENAME} $$test .sh` ; \
79            (for fmt in ${TEST_FORMATS}; do \
80	        echo "... $$test ... $$fmt ..."; \
81	        ${CP} out/$$base.$$fmt.out ${srcdir}/saved/$$base.$$fmt.out ; \
82	        ${CP} out/$$base.$$fmt.err ${srcdir}/saved/$$base.$$fmt.err ; \
83	    done) \
84	done)
85
86CLEANFILES =
87CLEANDIRS = out
88
89clean-local:
90	rm -rf ${CLEANDIRS}
91