Blame SOURCES/run-misc-tests.sh

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