xref: /freebsd/contrib/libxo/tests/xo/Makefile.am (revision 02e9120893770924227138ba49df1edb3896112a)
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 \
16xo_02.sh
17
18# TEST_CASES := $(shell cd ${srcdir} ; echo *.c )
19
20EXTRA_DIST = \
21    ${TEST_CASES} \
22    ${addprefix saved/, ${TEST_CASES:.sh=.T.err}} \
23    ${addprefix saved/, ${TEST_CASES:.sh=.T.out}} \
24    ${addprefix saved/, ${TEST_CASES:.sh=.XP.err}} \
25    ${addprefix saved/, ${TEST_CASES:.sh=.XP.out}} \
26    ${addprefix saved/, ${TEST_CASES:.sh=.JP.err}} \
27    ${addprefix saved/, ${TEST_CASES:.sh=.JP.out}} \
28    ${addprefix saved/, ${TEST_CASES:.sh=.HP.err}} \
29    ${addprefix saved/, ${TEST_CASES:.sh=.HP.out}} \
30    ${addprefix saved/, ${TEST_CASES:.sh=.X.err}} \
31    ${addprefix saved/, ${TEST_CASES:.sh=.X.out}} \
32    ${addprefix saved/, ${TEST_CASES:.sh=.J.err}} \
33    ${addprefix saved/, ${TEST_CASES:.sh=.J.out}} \
34    ${addprefix saved/, ${TEST_CASES:.sh=.H.err}} \
35    ${addprefix saved/, ${TEST_CASES:.sh=.H.out}} \
36    ${addprefix saved/, ${TEST_CASES:.sh=.HIPx.err}} \
37    ${addprefix saved/, ${TEST_CASES:.sh=.HIPx.out}}
38
39S2O = | ${SED} '1,/@@/d'
40
41all:
42
43#TEST_TRACE = set -x ;
44
45XO=../../xo/xo
46
47TEST_ONE = \
48      ${CHECKER} sh ${srcdir}/$$base.sh "${XO} --libxo:W$$fmt" ${TEST_OPTS} \
49      > out/$$base.$$fmt.out 2> out/$$base.$$fmt.err ; \
50 ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.out out/$$base.$$fmt.out ${S2O} ; \
51 ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.err out/$$base.$$fmt.err ${S2O}
52
53TEST_FORMATS = T XP JP HP X J H HIPx
54
55test tests: ${bin_PROGRAMS}
56	@${MKDIR} -p out
57	-@ ${TEST_TRACE} (for test in ${TEST_CASES} ; do \
58	    base=`${BASENAME} $$test .sh` ; \
59            (for fmt in ${TEST_FORMATS}; do \
60	        echo "... $$test ... $$fmt ..."; \
61	        ${TEST_ONE}; \
62                true; \
63            done) \
64	done)
65
66one:
67	-@(test=${TEST_CASE}; data=${TEST_DATA}; ${TEST_ONE} ; true)
68
69accept:
70	-@(for test in ${TEST_CASES} ; do \
71	    base=`${BASENAME} $$test .sh` ; \
72            (for fmt in ${TEST_FORMATS}; do \
73	        echo "... $$test ... $$fmt ..."; \
74	        ${CP} out/$$base.$$fmt.out ${srcdir}/saved/$$base.$$fmt.out ; \
75	        ${CP} out/$$base.$$fmt.err ${srcdir}/saved/$$base.$$fmt.err ; \
76	    done) \
77	done)
78
79CLEANFILES =
80CLEANDIRS = out
81
82clean-local:
83	rm -rf ${CLEANDIRS}
84