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