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