Blame tests/converterSample/runtest.sh
|
Al Stone |
69fdad |
#!/bin/bash
|
|
Al Stone |
69fdad |
#
|
|
Al Stone |
69fdad |
# run the misc tests: we need to do this in a script since
|
|
Al Stone |
69fdad |
# these are expected to fail which would normally cause %check
|
|
Al Stone |
69fdad |
# to stop. however, this is expected behavior. we are running
|
|
Al Stone |
69fdad |
# iasl precisely because we expect it to stop when presented with
|
|
Al Stone |
69fdad |
# faulty ASL.
|
|
Al Stone |
69fdad |
#
|
|
Al Stone |
69fdad |
# this script assumes it is in the source 'tests' directory at
|
|
Al Stone |
69fdad |
# start.
|
|
Al Stone |
69fdad |
#
|
|
Al Stone |
69fdad |
|
|
Al Stone |
69fdad |
PWD=$(pwd)
|
|
Al Stone |
69fdad |
BINDIR="/usr/bin"
|
|
Al Stone |
69fdad |
VERSION=$($BINDIR/iasl -v | grep Optimizing | cut -d" " -f5)
|
|
Al Stone |
69fdad |
|
|
Al Stone |
69fdad |
# create file to compare against
|
|
Al Stone |
69fdad |
pushd ./converterSample > /dev/null
|
|
Al Stone |
69fdad |
sed -e "s/VVVVVVVV/$VERSION/" \
|
|
Al Stone |
69fdad |
converterSample.asl.result > converterSample.asl.expected
|
|
Al Stone |
69fdad |
|
|
Al Stone |
69fdad |
# see if converterSample.asl compiles as expected
|
|
Al Stone |
69fdad |
$BINDIR/iasl converterSample.asl > converterSample.asl.actual 2>&1
|
|
Al Stone |
69fdad |
diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
|
|
Al Stone |
69fdad |
RET=$?
|
|
Al Stone |
69fdad |
popd > /dev/null
|
|
Al Stone |
69fdad |
|
|
Al Stone |
69fdad |
if [ $RET -eq 0 ]
|
|
Al Stone |
69fdad |
then
|
|
Al Stone |
69fdad |
echo PASS converterSample
|
|
Al Stone |
69fdad |
else
|
|
Al Stone |
69fdad |
echo FAIL converterSample
|
|
Al Stone |
69fdad |
fi
|
|
Al Stone |
69fdad |
exit $RET
|