Al Stone afae4e
#!/bin/bash
Al Stone afae4e
#
Al Stone afae4e
#       run the misc tests: we need to do this in a script since
Al Stone afae4e
#       these are expected to fail which would normally cause %check
Al Stone afae4e
#       to stop.  however, this is expected behavior.  we are running
Al Stone afae4e
#       iasl precisely because we expect it to stop when presented with
Al Stone afae4e
#       faulty ASL.
Al Stone afae4e
#
Al Stone afae4e
#       this script assumes it is in the source 'tests' directory at
Al Stone afae4e
#       start.
Al Stone afae4e
#
Al Stone afae4e
Al Stone afae4e
set -x
Al Stone afae4e
Al Stone afae4e
BINDIR="$1"
Al Stone afae4e
VERSION="$2"
Al Stone afae4e
Al Stone afae4e
# create files to compare against
Al Stone afae4e
$BINDIR/iasl -h
Al Stone afae4e
Al Stone afae4e
m=`uname -m`
Al Stone afae4e
case $m in
Al Stone 4c70b5
    s390x | \
Al Stone afae4e
    *64) BITS=64
Al Stone afae4e
         ;;
Al Stone afae4e
    *)   BITS=32
Al Stone afae4e
         ;;
Al Stone afae4e
esac
Al Stone afae4e
WHEN=`date +"%b %_d %Y"`
Al Stone afae4e
sed -e "s/XXXXXXXXXXX/$WHEN/" \
Al Stone afae4e
    -e "s/YYYY/$BITS/" \
Al Stone afae4e
    -e "s/VVVVVVVV/$VERSION/" \
Al Stone afae4e
    ../badcode.asl.result > misc/badcode.asl.result
Al Stone afae4e
sed -e "s/XXXXXXXXXXX/$WHEN/" \
Al Stone afae4e
    -e "s/YYYY/$BITS/" \
Al Stone afae4e
    -e "s/VVVVVVVV/$VERSION/" \
Al Stone afae4e
    ../grammar.asl.result > misc/grammar.asl.result
Al Stone afae4e
Al Stone afae4e
cd misc
Al Stone afae4e
Al Stone afae4e
# see if badcode.asl failed as expected
Al Stone afae4e
# NB: the -f option is required so we can see all of the errors
Al Stone afae4e
$BINDIR/iasl -f badcode.asl 2>&1 | tee badcode
Al Stone afae4e
diff badcode badcode.asl.result >/dev/null 2>&1
Al Stone afae4e
[ $? -eq 0 ] || exit 1
Al Stone afae4e
Al Stone afae4e
# see if grammar.asl failed as expected
Al Stone afae4e
# NB: the -f option is required so we can see all of the errors
Al Stone afae4e
$BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar
Al Stone afae4e
diff grammar grammar.asl.result >/dev/null 2>&1
Al Stone afae4e
[ $? -eq 0 ] || exit 1
Al Stone afae4e
Al Stone afae4e
exit 0