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