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