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 = \ 15test_01.c \ 16test_02.c \ 17test_03.c \ 18test_04.c \ 19test_05.c \ 20test_06.c \ 21test_07.c \ 22test_08.c \ 23test_09.c \ 24test_10.c \ 25test_11.c 26 27test_01_test_SOURCES = test_01.c 28test_02_test_SOURCES = test_02.c 29test_03_test_SOURCES = test_03.c 30test_04_test_SOURCES = test_04.c 31test_05_test_SOURCES = test_05.c 32test_06_test_SOURCES = test_06.c 33test_07_test_SOURCES = test_07.c 34test_08_test_SOURCES = test_08.c 35test_09_test_SOURCES = test_09.c 36test_10_test_SOURCES = test_10.c 37test_11_test_SOURCES = test_11.c 38 39# TEST_CASES := $(shell cd ${srcdir} ; echo *.c ) 40 41noinst_PROGRAMS = ${TEST_CASES:.c=.test} 42 43LDADD = \ 44 ${top_builddir}/libxo/libxo.la 45 46if HAVE_HUMANIZE_NUMBER 47LDADD += -lutil 48endif 49 50EXTRA_DIST = \ 51 ${TEST_CASES} \ 52 ${addprefix saved/, ${TEST_CASES:.c=.T.err}} \ 53 ${addprefix saved/, ${TEST_CASES:.c=.T.out}} \ 54 ${addprefix saved/, ${TEST_CASES:.c=.XP.err}} \ 55 ${addprefix saved/, ${TEST_CASES:.c=.XP.out}} \ 56 ${addprefix saved/, ${TEST_CASES:.c=.JP.err}} \ 57 ${addprefix saved/, ${TEST_CASES:.c=.JP.out}} \ 58 ${addprefix saved/, ${TEST_CASES:.c=.HP.err}} \ 59 ${addprefix saved/, ${TEST_CASES:.c=.HP.out}} \ 60 ${addprefix saved/, ${TEST_CASES:.c=.X.err}} \ 61 ${addprefix saved/, ${TEST_CASES:.c=.X.out}} \ 62 ${addprefix saved/, ${TEST_CASES:.c=.J.err}} \ 63 ${addprefix saved/, ${TEST_CASES:.c=.J.out}} \ 64 ${addprefix saved/, ${TEST_CASES:.c=.H.err}} \ 65 ${addprefix saved/, ${TEST_CASES:.c=.H.out}} \ 66 ${addprefix saved/, ${TEST_CASES:.c=.HIPx.err}} \ 67 ${addprefix saved/, ${TEST_CASES:.c=.HIPx.out}} 68 69S2O = | ${SED} '1,/@@/d' 70 71all: 72 73valgrind: 74 @echo '## Running the regression tests under Valgrind' 75 ${MAKE} CHECKER='valgrind -q' tests 76 77#TEST_TRACE = set -x ; 78 79TEST_JIG = \ 80 ${CHECKER} ./$$base.test ${TEST_OPTS} \ 81 > out/$$base.$$fmt.out 2> out/$$base.$$fmt.err ; \ 82 ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.out out/$$base.$$fmt.out ${S2O} ; \ 83 ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.err out/$$base.$$fmt.err ${S2O} 84 85TEST_ONE = \ 86 LIBXO_OPTIONS=:W$$fmt ${TEST_JIG} 87 88TEST_TWO = \ 89 LIBXO_OPTIONS=warn,encoder=test ${TEST_JIG} 90 91TEST_FORMATS = T XP JP HP X J H HIPx 92 93test tests: ${bin_PROGRAMS} 94 @${MKDIR} -p out 95 -@ ${TEST_TRACE} (for test in ${TEST_CASES} ; do \ 96 base=`${BASENAME} $$test .c` ; \ 97 (for fmt in ${TEST_FORMATS}; do \ 98 echo "... $$test ... $$fmt ..."; \ 99 ${TEST_ONE}; \ 100 true; \ 101 done) ; \ 102 (for fmt in E; do \ 103 echo "... $$test ... $$fmt ..."; \ 104 ${TEST_TWO}; \ 105 true; \ 106 done) \ 107 done) 108 109one: 110 -@(test=${TEST_CASE}; data=${TEST_DATA}; ${TEST_ONE} ; true) 111 112accept: 113 -@(for test in ${TEST_CASES} ; do \ 114 base=`${BASENAME} $$test .c` ; \ 115 (for fmt in ${TEST_FORMATS} E; do \ 116 echo "... $$test ... $$fmt ..."; \ 117 ${CP} out/$$base.$$fmt.out ${srcdir}/saved/$$base.$$fmt.out ; \ 118 ${CP} out/$$base.$$fmt.err ${srcdir}/saved/$$base.$$fmt.err ; \ 119 done) \ 120 done) 121 122.c.test: 123 $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ $< 124 125CLEANFILES = ${TEST_CASES:.c=.test} 126CLEANDIRS = out 127 128clean-local: 129 rm -rf ${CLEANDIRS} 130