summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2017-08-28 22:31:07 +0800
committerErik Schmauss <erik.schmauss@intel.com>2017-08-30 15:05:37 -0700
commit5a5288114934668ef8e1590bb03a4ccfdfd1095b (patch)
tree400034011a5cc8fc4738a39168d741d3a26469b9 /tests
parentbf8ee64902b42656d30099af706ae7fee640351d (diff)
downloadacpica-5a5288114934668ef8e1590bb03a4ccfdfd1095b.tar.gz
iasl: Move aslversion determination logic from Makefile.def to Do script
Diffstat (limited to 'tests')
-rw-r--r--tests/aslts/Makefile.def68
-rw-r--r--tests/aslts/Makefile.switch12
-rwxr-xr-xtests/aslts/bin/Do30
3 files changed, 42 insertions, 68 deletions
diff --git a/tests/aslts/Makefile.def b/tests/aslts/Makefile.def
index 03dfb8aa2..ad3f199a6 100644
--- a/tests/aslts/Makefile.def
+++ b/tests/aslts/Makefile.def
@@ -40,11 +40,12 @@ ifeq ("$(ASLTS_MODE)", "o64")
ASLTS_ASLFLAGS="-r 2"
endif
endif
+ASLTS_VER ?= $(ASLTS_VER)
COMMON_ASL_FLAGS= "-of -cr -vs -l -sc -sa -ic -ta -ts -so -lm -ln -ls -li"
-COMPILER_LOG="$(TOP)/tmp/aml/$(aslversion)/compile.txt"
-COMPILER_ERROR_LOG="$(TOP)/tmp/aml/$(aslversion)/error.txt"
+COMPILER_LOG="$(TOP)/tmp/aml/$(ASLTS_VER)/compile.txt"
+COMPILER_ERROR_LOG="$(TOP)/tmp/aml/$(ASLTS_VER)/error.txt"
# Create general directory
@@ -58,14 +59,13 @@ ASLMOD= MAIN
empty_all: FORCE
# Rule to create directories located into aslts/tmp/aml;
-# aslversion is determined dynamically.
-$(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR):
+$(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR):
@$(INST.dir)
# Make-install one particular Test Case for all modes
-install_all_modes_of_test_case: $(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR)
+install_all_modes_of_test_case: $(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR)
@rval=0; \
if [ -f "$(ASL)" ]; then \
dd=`pwd`; \
@@ -165,8 +165,8 @@ install_all_modes_of_test_case: $(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR)
if [ $$ret != 0 ]; then break; fi; \
for j in ${AMLMOD}; do \
ls -l $$j.aml >> $(COMPILER_LOG); \
- echo "---- Move: $$j.aml $(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR)" >> $(COMPILER_LOG); \
- mv $$j.aml $(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR); \
+ echo "---- Move: $$j.aml $(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR)" >> $(COMPILER_LOG); \
+ mv $$j.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; \
@@ -177,64 +177,12 @@ install_all_modes_of_test_case: $(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR)
if [ $$rval != 0 ]; then exit 1; fi
# Make-install one particular Test Case for all modes.
-# Move results to aslts/tmp/aml directory.
-# Determine current version of iASL.
-# Create aslts/tmp/aml/<version> directory with the precautions.
install_test_case:
@if [ ! -f "$(ASL)" ]; then \
echo "Bad iASL 1: <$(ASL)> does not exist"; exit 1; \
else \
- aslversion=""; \
- testcasedir=`pwd`; \
- cd $(TOP); \
- if [ $$? -ne 0 ]; then \
- echo "Bad dir: $(TOP)"; exit 1; \
- else \
- dd=`pwd`; \
- base=`basename "$$dd"`; \
- if [ x$$base != xaslts ]; then \
- echo "Bad base name of ASLTS Test Suite: <$$base> of <$$dd>"; exit 1; \
- else \
- x=`"$(ASL)" -va xxx | grep "Compiler/Disassembler version"`; \
- echo "---- iASL version: $$x"; \
- if [ -z "$$x" ]; then \
- echo "Bad iASL 2: bad signon <$(ASL)>"; exit 1; \
- else \
- aslversion=`echo "$$x" | awk -F" " '{ print $$5}'`; \
- if [ -z "$$aslversion" ]; then \
- echo "Bad iASL 3: could not get version <$(ASL)>"; exit 1; \
- else \
- if [ ! -d ./tmp ]; then \
- mkdir tmp; \
- fi; \
- cd ./tmp; \
- if [ $$? -ne 0 ]; then \
- echo "Bad dir: aslts/tmp"; exit 1; \
- else \
- if [ ! -d ./aml ]; then \
- mkdir aml; \
- fi; \
- cd ./aml; \
- if [ $$? -ne 0 ]; then \
- echo "Bad dir: aslts/tmp/aml"; exit 1; \
- else \
- if [ ! -d "./$$aslversion" ]; then \
- mkdir $$aslversion; \
- fi; \
- cd ./$$aslversion; \
- if [ $$? -ne 0 ]; then \
- echo "Bad dir: aslts/tmp"; exit 1; \
- else \
- cd "$$testcasedir"; \
- export aslversion; make install_all_modes_of_test_case ASLTS_MODE=$(ASLTS_MODE) OPT=$(OPT); \
- fi; \
- fi; \
- fi; \
- fi; \
- fi; \
- fi; \
- fi; \
+ make install_all_modes_of_test_case ASLTS_MODE=$(ASLTS_MODE) OPT=$(OPT) ASLTS_VER=$(ASLTS_VER); \
fi
# Compile one particular Test Case for all modes.
diff --git a/tests/aslts/Makefile.switch b/tests/aslts/Makefile.switch
index 981694b0d..31aa11a36 100644
--- a/tests/aslts/Makefile.switch
+++ b/tests/aslts/Makefile.switch
@@ -1,5 +1,7 @@
# common switch make
+ASLTS_VER ?= 00000000
+
all: ${MDIRS}
${MDIRS}: FORCE
@cd $@; pwd; make
@@ -12,7 +14,7 @@ install: FORCE
else \
pwd; \
>&2 echo "Begin compiling test package: [$$d]"; \
- $(MAKE) install ASLTS_MODE=$(ASLTS_MODE); \
+ $(MAKE) install ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
if [ $$? -ne 0 ]; then \
r=1; \
false; \
@@ -25,13 +27,13 @@ install: FORCE
done
install_n32:
- $(MAKE) install ASLTS_MODE=n32
+ $(MAKE) install ASLTS_MODE=n32 ASLTS_VER=$(ASLTS_VER)
install_n64:
- $(MAKE) install ASLTS_MODE=n64
+ $(MAKE) install ASLTS_MODE=n64 ASLTS_VER=$(ASLTS_VER)
install_o32:
- $(MAKE) install ASLTS_MODE=o32
+ $(MAKE) install ASLTS_MODE=o32 ASLTS_VER=$(ASLTS_VER)
install_o64:
- $(MAKE) install ASLTS_MODE=o64
+ $(MAKE) install ASLTS_MODE=o64 ASLTS_VER=$(ASLTS_VER)
install_all: install_n32 install_n64 install_o32 install_o64
diff --git a/tests/aslts/bin/Do b/tests/aslts/bin/Do
index 17e5ad5be..f5e69eda2 100755
--- a/tests/aslts/bin/Do
+++ b/tests/aslts/bin/Do
@@ -297,21 +297,23 @@ do_bdemo_table()
make_target()
{
- local dir restore_dir mode options
+ local dir restore_dir mode options aslversion
restore_dir=$PWD
target=$1
dir="$2"
execonly=$3
mode=$4
+ aslversion=`get_iasl_version`
cd "$dir"
echo "Running make $target from $dir"
+ options="ASLTS_VER=$aslversion"
if [ "$execonly" = "yes" ]; then
- options="OPT=1"
+ options="$options OPT=1"
else
- options="OPT=0"
+ options="$options OPT=0"
fi
if [ ! -z $mode ]; then
options="$options ASLTS_MODE=$mode"
@@ -548,6 +550,28 @@ run_asl_compiler()
fi
}
+get_iasl_version()
+{
+ local x version
+
+ if [ ! -f $ASL ]; then
+ do_exit 1 "Bad iASL 1: <$ASL> does not exist"
+ else
+ x=`$ASL -version | grep "Compiler/Disassembler version"`
+ if [ x"$x" == x ]; then
+ version=00000000
+ do_exit 1 "Bad iASL 2: bad signon <$ASL>"
+ else
+ version=`echo "$x" | awk -F" " '{print $5}'`
+ if [ x"$version" == x ]; then
+ do_exit 1 "Bad iASL 3: could not get version <$ASL>"
+ else
+ echo "$version"
+ fi
+ fi
+ fi
+}
+
get_aslts_bin_line()
{
echo "$1" | awk -F: '{ for (i=1; i<=NF; i++) { print $i}}' |\