Add converterSample.asl test to %check, and clean up the script a bit

Signed-off-by: Al Stone <ahs3@redhat.com>
This commit is contained in:
Al Stone 2018-08-08 18:24:44 -06:00
parent d2ff7eb62a
commit 58c4aaf2e7
3 changed files with 52 additions and 37 deletions

View File

@ -21,8 +21,9 @@ Source10: acpixtract.1
Source11: acpiexamples.1
Source12: badcode.asl.result
Source13: grammar.asl.result
Source14: run-misc-tests.sh
Source15: COPYING
Source14: converterSample.asl.result
Source15: run-misc-tests.sh
Source16: COPYING
Patch0: big-endian.patch
Patch1: unaligned.patch
@ -121,11 +122,13 @@ cp -p %{SOURCE7} acpihelp.1
cp -p %{SOURCE8} acpinames.1
cp -p %{SOURCE9} acpisrc.1
cp -p %{SOURCE10} acpixtract.1
cp -p %{SOURCE11} badcode.asl.result
cp -p %{SOURCE12} grammar.asl.result
cp -p %{SOURCE13} tests/run-misc-tests.sh
cp -p %{SOURCE11} acpiexamples.1
cp -p %{SOURCE12} badcode.asl.result
cp -p %{SOURCE13} grammar.asl.result
cp -p %{SOURCE14} converterSample.asl.result
cp -p %{SOURCE15} tests/run-misc-tests.sh
chmod a+x tests/run-misc-tests.sh
cp -p %{SOURCE14} COPYING
cp -p %{SOURCE16} COPYING
# spurious executable permissions on text files in upstream
chmod a-x changes.txt
@ -241,6 +244,9 @@ fi
- Add in man page for acpiexamples. So that the man page makes some sense,
also copy the source code used for acpiexamples to the doc directory for
this package. Closes BZ#1611145.
- Add in the converterSample.asl file from the misc tests. Clean up the
run-misc-tests.sh script, too, to make it more robust by simplifying
the work done.
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20180629-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

View File

@ -0,0 +1,21 @@
converterSample.asl 37: Method(MAIN) {
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
converterSample.asl 48: Name(b,0);
Remark 2089 - Object is not referenced ^ (Name [B___] is within a method [MAIN])
converterSample.asl 65: Method(SCOP)
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
converterSample.asl 68: Name (a1, 0x04)
Remark 2089 - Object is not referenced ^ (Name [A1__] is within a method [SCOP])
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2018 Intel Corporation
ASL Input: converterSample.asl - 85 lines, 1968 bytes, 11 keywords
AML Output: converterSample.aml - 180 bytes, 9 named objects, 2 executable opcodes
Compilation complete. 0 Errors, 0 Warnings, 4 Remarks, 11 Optimizations, 1 Constants Folded

View File

@ -1,10 +1,10 @@
#!/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.
# some of these are expected to fail which would normally cause
# the %check step 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 source 'tests' directory at
# start.
@ -18,42 +18,30 @@ VERSION="$2"
# create files to compare against
$BINDIR/iasl -h
m=`uname -m`
case $m in
s390x | ppc64le | \
*64) BITS=64
;;
*) BITS=32
;;
esac
# if a build starts before midnight, but ends after midnight, this
# test can get confused. 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/XXXXXXXXXXX/$WHEN/" \
-e "s/YYYY/$BITS/" \
-e "s/VVVVVVVV/$VERSION/" \
../badcode.asl.result > misc/badcode.asl.result
sed -e "s/XXXXXXXXXXX/$WHEN/" \
-e "s/YYYY/$BITS/" \
-e "s/VVVVVVVV/$VERSION/" \
../grammar.asl.result > misc/grammar.asl.result
sed -e "s/VVVVVVVV/$VERSION/" \
../badcode.asl.result > misc/badcode.asl.expected
sed -e "s/VVVVVVVV/$VERSION/" \
../grammar.asl.result > misc/grammar.asl.expected
sed -e "s/VVVVVVVV/$VERSION/" \
../converterSample.asl.result > misc/converterSample.asl.expected
cd misc
# 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
diff badcode badcode.asl.result >/dev/null 2>&1
$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
diff grammar grammar.asl.result >/dev/null 2>&1
$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 succeeded as expected
$BINDIR/iasl converterSample.asl 2>&1 | tee converterSample.asl.actual
diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
[ $? -ne 0 ] && exit 1
exit 0