Blame SOURCES/run-misc-tests.sh

44a778
#!/bin/bash
44a778
#
44a778
#       run the misc tests: we need to do this in a script since
44a778
#       these are expected to fail which would normally cause %check
44a778
#       to stop.  however, this is expected behavior.  we are running
44a778
#       iasl precisely because we expect it to stop when presented with
44a778
#       faulty ASL.
44a778
#
44a778
#       this script assumes it is in the source 'tests' directory at
44a778
#       start.
44a778
#
44a778
44a778
set -x
44a778
44a778
BINDIR="$1"
44a778
VERSION="$2"
44a778
44a778
# create files to compare against
44a778
$BINDIR/iasl -h
44a778
44a778
m=`uname -m`
44a778
case $m in
44a778
    s390x | \
44a778
    *64le | \
44a778
    *64) BITS=64
44a778
         ;;
44a778
    *)   BITS=32
44a778
         ;;
44a778
esac
44a778
44a778
# if a build starts before midnight, but ends after midnight, this
44a778
# test can get confused.  grab the date from the iasl file we just
44a778
# built so they match regardless.
44a778
FDATE=`stat --format="%Y" $BINDIR/iasl | cut -d" " -f1`
44a778
WHEN=`date --date="@$FDATE" +"%b %_d %Y"`
44a778
44a778
sed -e "s/XXXXXXXXXXX/$WHEN/" \
44a778
    -e "s/YYYY/$BITS/" \
44a778
    -e "s/VVVVVVVV/$VERSION/" \
44a778
    ../badcode.asl.result > misc/badcode.asl.result
44a778
sed -e "s/XXXXXXXXXXX/$WHEN/" \
44a778
    -e "s/YYYY/$BITS/" \
44a778
    -e "s/VVVVVVVV/$VERSION/" \
44a778
    ../grammar.asl.result > misc/grammar.asl.result
44a778
44a778
cd misc
44a778
44a778
# see if badcode.asl failed as expected
44a778
# NB: the -f option is required so we can see all of the errors
44a778
$BINDIR/iasl -f badcode.asl 2>&1 | tee badcode
44a778
diff badcode badcode.asl.result >/dev/null 2>&1
44a778
[ $? -eq 0 ] || exit 1
44a778
44a778
# see if grammar.asl failed as expected
44a778
# NB: the -f option is required so we can see all of the errors
44a778
$BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar
44a778
diff grammar grammar.asl.result >/dev/null 2>&1
44a778
[ $? -eq 0 ] || exit 1
44a778
44a778
exit 0