Blame SOURCES/run-misc-tests.sh

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