9897bb
#!/bin/bash
9897bb
#
9897bb
#       run the misc tests: we need to do this in a script since
9897bb
#       some of these are expected to fail which would normally cause
9897bb
#	the %check step to stop.  however, this is expected behavior.
9897bb
#	we are running iasl precisely because we expect it to stop when
9897bb
#	presented with faulty ASL.
9897bb
#
9897bb
#       this script assumes it is in the source 'tests' directory at
9897bb
#       start.
9897bb
#
9897bb
9897bb
set -x
9897bb
9897bb
BINDIR="$1"
9897bb
VERSION="$2"
9897bb
9897bb
# create files to compare against
9897bb
$BINDIR/iasl -hZZ
9897bb
9897bb
sed -e "s/VVVVVVVV/$VERSION/" \
9897bb
    ../badcode.asl.result > misc/badcode.asl.expected
9897bb
sed -e "s/VVVVVVVV/$VERSION/" \
9897bb
    ../grammar.asl.result > misc/grammar.asl.expected
9897bb
sed -e "s/VVVVVVVV/$VERSION/" \
9897bb
    ../converterSample.asl.result > misc/converterSample.asl.expected
9897bb
9897bb
cd misc
9897bb
9897bb
# see if badcode.asl failed as expected
9897bb
# NB: the -f option is required so we can see all of the errors
9897bb
$BINDIR/iasl -f badcode.asl 2>&1 | tee badcode.asl.actual
9897bb
diff badcode.asl.actual badcode.asl.expected >/dev/null 2>&1
9897bb
[ $? -eq 0 ] || exit 1
9897bb
9897bb
# see if grammar.asl failed as expected
9897bb
# NB: the -f option is required so we can see all of the errors
9897bb
$BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar.asl.actual
9897bb
diff grammar.asl.actual grammar.asl.expected >/dev/null 2>&1
9897bb
[ $? -eq 0 ] || exit 1
9897bb
9897bb
# see if converterSample.asl failed as expected
9897bb
# NB: the -f option is required so we can see all of the errors
9897bb
$BINDIR/iasl -f -of converterSample.asl 2>&1 | tee converterSample.asl.actual
9897bb
diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
9897bb
[ $? -eq 0 ] || exit 1
9897bb
9897bb
exit 0