1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/bin/bash
#
# run the misc tests: we need to do this in a script since
# these are expected to fail which would normally cause %check
# to stop. however, this is expected behavior. we are running
# iasl precisely because we expect it to stop when presented with
# faulty ASL.
#
# this script assumes it is in the root of the source directory at
# start.
#
set -x
CURDIR="$1"
BINDIR="$1/generate/unix/bin"
DEBDIR="$1/debian"
VERSION="$2"
cd $CURDIR/tests/misc
# create files to compare against
$BINDIR/iasl -h
BITS=$(dpkg-architecture -qDEB_HOST_ARCH_BITS)
# if the build happens to start before midnight, the date gets
# confused in the comparison later on if the build goes past
# midnight. grab the date from the iasl file we just built so
# they match regardless.
FDATE=`stat --format="%Y" $BINDIR/iasl | cut -d" " -f1`
WHEN=`date --date="@$FDATE" +"%b %_d %Y"`
sed -e "s/VVVVVVVV/$VERSION/" \
$DEBDIR/badcode.asl.result > badcode.asl.expected
sed -e "s/VVVVVVVV/$VERSION/" \
$DEBDIR/grammar.asl.result > grammar.asl.expected
sed -e "s/VVVVVVVV/$VERSION/" \
$DEBDIR/converterSample.asl.result > converterSample.asl.expected
# see if badcode.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f badcode.asl 2>&1 | tee badcode.asl.actual
diff badcode.asl.actual badcode.asl.expected >/dev/null 2>&1
[ $? -eq 0 ] || exit 1
# see if grammar.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar.asl.actual
diff grammar.asl.actual grammar.asl.expected >/dev/null 2>&1
[ $? -eq 0 ] || exit 1
# see if converterSample.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f -of converterSample.asl 2>&1 | tee converterSample.asl.actual
diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
[ $? -eq 0 ] || exit 1
exit 0
|