Blame SOURCES/run-misc-tests.sh

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