summaryrefslogtreecommitdiff
path: root/tests/aslts
diff options
context:
space:
mode:
authorErik Schmauss <erik.schmauss@intel.com>2017-09-08 13:03:39 -0700
committerErik Schmauss <erik.schmauss@intel.com>2017-09-08 13:47:37 -0700
commitd6583fe044e1e3d768d0ea57190a17aa32e532c5 (patch)
tree2145b76a13f51c9a0f2138c857e99f38acd8fb4d /tests/aslts
parentb7a80eaf3185fca5d0d6117b741f1da9e2cc0e1a (diff)
downloadacpica-d6583fe044e1e3d768d0ea57190a17aa32e532c5.tar.gz
ASLTS: add converter test sequence and rename all .dsl files to .asl
This is similar to the ASLTS disassembler test sequence. The converter test sequence converts each test case using iasl -ca flag and then recompiles using flags from a normal test case compilation. After recompilation, normally compiled AML is compared with the converted and recompiled AML. Converter test sequence removes all .dsl files after testing. Because of this, all .dsl files that belong in the ASLTS directory needs to be renamed as .asl. Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Diffstat (limited to 'tests/aslts')
-rw-r--r--tests/aslts/Makefile.def52
-rw-r--r--tests/aslts/Makefile.switch4
-rwxr-xr-xtests/aslts/bin/Do10
-rw-r--r--tests/aslts/src/runtime/collections/Identity2MS/abbu/UTILITY/DSDT.asl (renamed from tests/aslts/src/runtime/collections/Identity2MS/abbu/UTILITY/DSDT.dsl)0
4 files changed, 65 insertions, 1 deletions
diff --git a/tests/aslts/Makefile.def b/tests/aslts/Makefile.def
index 8545c7df4..8666f1cee 100644
--- a/tests/aslts/Makefile.def
+++ b/tests/aslts/Makefile.def
@@ -47,6 +47,11 @@ ifeq ("$(ASLTS_MODE)", "aslplus")
ASLTS_AMLDIR=aslplus/
ASLTS_ASLFLAGS="-oa -r 2"
endif
+ifeq ("$(ASLTS_MODE)", "aslconvert")
+ ASLTS_AMLDIR=aslconvert/
+ ASLTS_ASLFLAGS="-oa -r 2"
+endif
+
endif
ASLTS_VER ?= $(ASLTS_VER)
@@ -136,6 +141,8 @@ install_test_case:
make install_disasm_test_case DISASM_FLAG="-dl" ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
elif [ "$(ASLTS_MODE)" = "aslplus" ]; then \
make install_disasm_test_case DISASM_FLAG="-d" ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
+ elif [ "$(ASLTS_MODE)" = "aslconvert" ]; then \
+ make install_converter_test_case ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
else \
make install_all_modes_of_test_case ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
fi
@@ -199,6 +206,51 @@ install_disasm_test_case:
>&2 echo "Skipping disassembler test for this test case"; \
fi;
+converter_test_convert: $(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR)
+ @rval=0; \
+ for j in ${ASLMOD} $(ASLMODADD); do \
+ >&2 printf " Convert"; \
+ "$(ASL)" -cr -ca $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \
+ ret=$$?; \
+ if [ $$ret != 0 ]; then \
+ rval=2; \
+ >&2 printf " [[ Error: conversion of $$j.asl failed ]]\n"; \
+ >&2 printf " Flags used: -ca\n\n"; \
+ fi; \
+ done; \
+ if [ $$rval != 0 ]; then exit 1; fi
+
+converter_test_recompile: converter_test_convert
+ @rval=0; \
+ for j in ${ASLMOD} $(ASLMODADD); do \
+ for k in ${AMLMOD}; do \
+ >&2 printf " => Recompile"; \
+ "$(ASL)" $(TEST_SEQUENCE_ASL_FLAGS) -p $$k $$j.dsl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \
+ ret=$$?; \
+ if [ $$ret != 0 ]; then \
+ rval=2; \
+ >&2 printf " [[ Error: re-compilation of $$j.dsl failed]]\n"; \
+ >&2 printf " Flags used: $(TEST_SEQUENCE_ASL_FLAGS) -p $$k\n\n"; \
+ else \
+ >&2 printf " => Done\n"; \
+ fi; \
+ echo "---- Move: $$k.aml $(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR)" >> $(COMPILER_LOG); \
+ mv $$k.aml $(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR); \
+ ret=$$?; \
+ if [ $$ret != 0 ]; then rval=2; echo "**** mv failed!" >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); break; fi; \
+ done; \
+ done; \
+
+install_converter_test_case:
+ if [ "x$(ADD_ASLFLAGS)" != "x-f" ]; then \
+ make converter_test_recompile; \
+ make clean; \
+ else \
+ >&2 echo "Skipping converter test for this test case"; \
+ fi;
+
+
+
# Compile one particular Test Case for all modes.
# No moving results to aslts/tmp/aml directory.
diff --git a/tests/aslts/Makefile.switch b/tests/aslts/Makefile.switch
index 3a449da6f..96bcab386 100644
--- a/tests/aslts/Makefile.switch
+++ b/tests/aslts/Makefile.switch
@@ -38,8 +38,10 @@ install_aslminus:
$(MAKE) install ASLTS_MODE=aslminus ASLTS_VER=$(ASLTS_VER)
install_aslplus:
$(MAKE) install ASLTS_MODE=aslplus ASLTS_VER=$(ASLTS_VER)
+install_aslconvert:
+ $(MAKE) install ASLTS_MODE=aslconvert ASLTS_VER=$(ASLTS_VER)
-install_all: install_n32 install_n64 install_o32 install_o64 install_aslminus install_aslplus
+install_all: install_n32 install_n64 install_o32 install_o64 install_aslminus install_aslplus install_aslconvert
clean: FORCE
@for d in ${MDIRS}; do \
diff --git a/tests/aslts/bin/Do b/tests/aslts/bin/Do
index 6cc151d58..0ea8d6821 100755
--- a/tests/aslts/bin/Do
+++ b/tests/aslts/bin/Do
@@ -401,6 +401,16 @@ make_install()
res=$nres
fi
fi
+ echo "Make ASL convert"
+ make_target install "$1" "aslconvert"
+ find . -type f -name *.dsl -delete
+ nres=$?
+ binary_compare "aslconvert"
+ nres=$(($nres+ $?))
+ if [ $nres -ne 0 ]; then
+ res=$(($res + $nres))
+ fi
+
echo "Make ASL plus"
make_target install "$1" "aslplus"
nres=$?
diff --git a/tests/aslts/src/runtime/collections/Identity2MS/abbu/UTILITY/DSDT.dsl b/tests/aslts/src/runtime/collections/Identity2MS/abbu/UTILITY/DSDT.asl
index 501dfbaff..501dfbaff 100644
--- a/tests/aslts/src/runtime/collections/Identity2MS/abbu/UTILITY/DSDT.dsl
+++ b/tests/aslts/src/runtime/collections/Identity2MS/abbu/UTILITY/DSDT.asl