xref: /freebsd/contrib/libucl/tests/schema.test (revision d9f0ce31900a48d1a2bfc1c8c86f79d1e831451a)
197bd480fSBaptiste Daroussin#!/bin/sh
297bd480fSBaptiste Daroussin
397bd480fSBaptiste DaroussinPROG=${TEST_BINARY_DIR}/test_schema
497bd480fSBaptiste Daroussinrm /tmp/_ucl_test_schema.out ||true
5*d9f0ce31SBaptiste Daroussin_succeed=0
6*d9f0ce31SBaptiste Daroussin_tests=0
797bd480fSBaptiste Daroussinfor i in ${TEST_DIR}/schema/*.json ; do
897bd480fSBaptiste Daroussin	_name=`basename $i`
997bd480fSBaptiste Daroussin	printf "running schema test suite $_name... "
10*d9f0ce31SBaptiste Daroussin	$PROG >> /tmp/_ucl_test_schema.out < $i
11*d9f0ce31SBaptiste Daroussin	if [ $? -eq 0 ] ; then
12*d9f0ce31SBaptiste Daroussin	    echo "OK"
13*d9f0ce31SBaptiste Daroussin	    _succeed=$(($_succeed + 1))
14*d9f0ce31SBaptiste Daroussin	else
15*d9f0ce31SBaptiste Daroussin	    echo "Fail"
16*d9f0ce31SBaptiste Daroussin	fi
17*d9f0ce31SBaptiste Daroussin	_tests=$(($_tests + 1))
1897bd480fSBaptiste Daroussindone
19*d9f0ce31SBaptiste Daroussin
20*d9f0ce31SBaptiste Daroussinif [ $_tests -ne $_succeed ] ; then
21*d9f0ce31SBaptiste Daroussin    exit 1
22*d9f0ce31SBaptiste Daroussinfi
23