~ubuntu-branches/ubuntu/maverick/libvirt/maverick

« back to all changes in this revision

Viewing changes to tests/test_conf.sh

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-06-25 18:51:21 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream) (0.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20080625185121-8dku38gpoluks1bx
Tags: upstream-0.4.4
ImportĀ upstreamĀ versionĀ 0.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
set -x
3
 
NOK=0
4
 
for f in $abs_top_srcdir/tests/confdata/*.conf
 
1
#!/bin/sh
 
2
 
 
3
if test "$VERBOSE" = yes; then
 
4
  set -x
 
5
  virsh --version
 
6
fi
 
7
 
 
8
. $srcdir/test-lib.sh
 
9
 
 
10
set -e
 
11
if test "x$abs_srcdir" = x; then
 
12
  abs_srcdir=`pwd`
 
13
  abs_builddir=`pwd`
 
14
fi
 
15
 
 
16
fail=0
 
17
i=1
 
18
data_dir=$abs_srcdir/confdata
 
19
for f in $(cd "$data_dir" && echo *.conf)
5
20
do
6
 
    ./conftest $f > conftest.$$
7
 
    outfile=`echo "$f" | sed s+\.conf$+\.out+`
8
 
    diff $outfile conftest.$$ > /dev/null
9
 
    if [ $? != 0 ]
10
 
    then
11
 
        if [ -n "$DEBUG_TESTS" ]; then
12
 
            diff -u $outfile conftest.$$
13
 
        fi
14
 
        echo "$f                                        FAILED"
15
 
        NOK=1
 
21
    "$abs_builddir/conftest" "$data_dir/$f" > "$f-actual"
 
22
    expected="$data_dir"/`echo "$f" | sed s+\.conf$+\.out+`
 
23
    if compare "$expected" "$f-actual"; then
 
24
        msg=OK
16
25
    else
17
 
        echo "$f                                        OK"
 
26
        msg=FAILED
 
27
        fail=1
18
28
    fi
 
29
    printf "%2d) %-60s      ... %s\n" $i "$f" $msg
 
30
    i=`expr $i + 1`
19
31
done
20
 
rm -f conftest.$$
21
 
exit $NOK
 
32
 
 
33
(exit $fail); exit $fail