]> git.ozlabs.org Git - petitboot/blob - test/urls/run-url-test.in
test/parser: Add pxe tests
[petitboot] / test / urls / run-url-test.in
1 #!/bin/bash
2
3 parser="@abs_builddir@/parse-url"
4 testfile=$1
5
6 url=$(head -n1 $testfile)
7
8 tmp=$(mktemp)
9 trap "rm $tmp" EXIT
10
11 $parser $url > $tmp
12 if test $? -ne 0
13 then
14         echo "Error running $parser on $testfile"
15         exit 2
16 fi
17
18 cmp --silent $testfile $tmp
19 result=$?
20
21 if test $result -ne 0
22 then
23         echo "FAIL: URL parse results differ:"
24         diff -u $testfile $tmp
25 fi
26
27 exit $result