From 2992688b8f0b656db42a7adc12ed62bdcbb965dd Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 11 Jun 2010 14:13:21 -0700 Subject: [PATCH] Tests: new test for template generator and data table compiler. in tests/templates. --- .gitignore | 5 ---- tests/templates/Makefile | 9 +++++++ tests/templates/templates.sh | 50 ++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 5 deletions(-) mode change 100644 => 100755 .gitignore create mode 100644 tests/templates/Makefile create mode 100755 tests/templates/templates.sh diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index dbbc5f974..da483ead3 --- a/.gitignore +++ b/.gitignore @@ -60,11 +60,6 @@ libraries/size_dbg.txt libraries/size_rel.txt libraries/apitest.exe -tests/tmp -tests/misc/*.aml -tests/aapits/tmp/ -tests/aslts/tmp/ - *.sh new patches diff --git a/tests/templates/Makefile b/tests/templates/Makefile new file mode 100644 index 000000000..1880dcc04 --- /dev/null +++ b/tests/templates/Makefile @@ -0,0 +1,9 @@ + +PROG= templates + +templates : + sh templates.sh + +clean : + rm -f *.asl *.aml *.dsl *.hex diff.log + diff --git a/tests/templates/templates.sh b/tests/templates/templates.sh new file mode 100755 index 000000000..efe1510fd --- /dev/null +++ b/tests/templates/templates.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +rm -f *.aml *.asl *.dsl *.log + +files=`ls` + +if [ "$1" == 1 ]; then + ASL_COMPILER="../../generate/unix/bin/iasl" +else + ASL_COMPILER="iasl" +fi + +echo "Using $ASL_COMPILER" + +# +# Create and compile the terse (normal) templates just +# to ensure that they will emit and compile +# +$ASL_COMPILER -T ALL > /dev/null 2>&1 +$ASL_COMPILER -y *.asl > /dev/null 2>&1 + +rm -f *.aml *.asl *.dsl *.log + +# Create the templates (use verbose mode) + +$ASL_COMPILER -vt -T ALL > /dev/null 2>&1 + +# Compile the templates + +$ASL_COMPILER -y *.asl > /dev/null 2>&1 + +# Disassemble the compiled templates + +$ASL_COMPILER -d *.aml > /dev/null 2>&1 + +> diff.log + +# +# Compare templates to compiled/disassembled templates +# +for f in $files ; do + if [ "$f" != "$0" ] && [ "$f" != "Makefile" ]; then + sig=`echo $f | awk -F. '{print $1}'` + + # Ignore differences in the comment/header field + + diff -pu -I" \*" $sig.asl $sig.dsl >> diff.log + fi +done +