Blame SOURCES/run-misc-tests.sh

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