Sophie

Sophie

distrib > Fedora > 15 > x86_64 > by-pkgid > 8bc706969a84a534bf10c0044c6455f5 > files > 52

dgc-0.98-4.fc15.x86_64.rpm

#!/bin/sh

TESTNAME=t01
DGC=/usr/bin/dgc
EXAMPLE=/usr/share/dgc/example.bex
GENLIB=/usr/share/dgc/default.genlib

if [ ! -f $DGC ]; then
    echo "$DGC doesn't exist"
    exit 1
fi

if [ ! -f $EXAMPLE ]; then
    echo "$EXAMPLE doesn't exist"
    exit 1
fi

if [ ! -f $GENLIB ]; then
    echo "$GENLIB doesn't exist"
    exit 1
fi

$DGC -ll -9 $EXAMPLE -lib $GENLIB -op tmp

test_list=(".i 3" "10- 0100100" "11- 1101011" "0-- 0010100")

for (( i=0; i<${#test_list}; i++ )); do
    TEST=`grep -c "${test_list[$i]}" tmp`
    if [ $TEST -eq 0 ]; then
	echo "$TEST ... failed"
	exit 1
    fi
done

echo "$TESTNAME ... success."
echo "Removing $TESTNAME tmp"
rm tmp