summaryrefslogtreecommitdiffstats
path: root/contrib/libucl/tests/basic.test
blob: 174cc8c3f0f17d3618993dd03047a99fa5e37add (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

PROG=${TEST_BINARY_DIR}/test_basic

for _tin in ${TEST_DIR}/basic/*.in ; do
	_t=`echo $_tin | sed -e 's/.in$//'`
	_out=${TEST_OUT_DIR}/basic.out
	$PROG $_t.in $_out
	if [ $? -ne 0 ] ; then
		echo "Test: $_t failed, output:"
		cat $_out
		rm $_out
		exit 1
	fi
	if [ -f $_t.res ] ; then
	diff -s $_out $_t.res -u 2>/dev/null
		if [ $? -ne 0 ] ; then
			rm $_out
			echo "Test: $_t output missmatch"
			exit 1
		fi
	fi
	rm $_out
	# Use FD interface
	$PROG -f $_t.in > /dev/null
	# JSON output
	$PROG -j $_t.in > /dev/null
	$PROG -c -j $_t.in > /dev/null
	# YAML output
	$PROG -y $_t.in > /dev/null
	# Save comments mode
	$PROG -C $_t.in > /dev/null
	# Save macro mode
	$PROG -M $_t.in > /dev/null
	$PROG -M -C $_t.in > /dev/null
done


OpenPOWER on IntegriCloud