summaryrefslogtreecommitdiffstats
path: root/test/urls/run-url-test.in
blob: 834166f9e4cf8f7dcef595e4bdb540d23dbed155 (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
#!/bin/bash

parser="@abs_builddir@/parse-url"
testfile=$1

url=$(head -n1 $testfile)

tmp=$(mktemp)
trap "rm $tmp" EXIT

$parser $url > $tmp
if test $? -ne 0
then
	echo "Error running $parser on $testfile"
	exit 2
fi

cmp --silent $testfile $tmp
result=$?

if test $result -ne 0
then
	echo "FAIL: URL parse results differ:"
	diff -u $testfile $tmp
fi

exit $result
OpenPOWER on IntegriCloud