diff options
author | Lv Zheng <lv.zheng@intel.com> | 2017-08-28 22:31:07 +0800 |
---|---|---|
committer | Erik Schmauss <erik.schmauss@intel.com> | 2017-08-30 15:05:37 -0700 |
commit | bf8ee64902b42656d30099af706ae7fee640351d (patch) | |
tree | c4e5aff3fcf7bef3ff3a3f639c62a44e75c35253 /tests | |
parent | 66b85dc8741c4fc44c059acc90a690b7abf46143 (diff) | |
download | acpica-bf8ee64902b42656d30099af706ae7fee640351d.tar.gz |
ASLTS: Split install target into install_n32/n64/s32/s64
This patch splits install target into install_n32/n64/s32/s64 targets
so that they can be invoked from "Do" script separately. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/aslts/Makefile.def | 240 | ||||
-rw-r--r-- | tests/aslts/Makefile.switch | 24 | ||||
-rwxr-xr-x | tests/aslts/bin/Do | 59 |
3 files changed, 192 insertions, 131 deletions
diff --git a/tests/aslts/Makefile.def b/tests/aslts/Makefile.def index ab55a1796..03dfb8aa2 100644 --- a/tests/aslts/Makefile.def +++ b/tests/aslts/Makefile.def @@ -22,9 +22,25 @@ # nopt/32 | -oa | -r 1 # nopt/64 | -oa | -r 2 -SETOF_INDEXES= 0 1 2 3 -SETOF_AMLDIRS= nopt/32 nopt/64 opt/32 opt/64 -SETOF_ASLFAGS= "-oa -r 1" "-oa -r 2" "-r 1" "-r 2" +ifndef ASLTS_AMLDIR +ifeq ("$(ASLTS_MODE)", "n32") + ASLTS_AMLDIR=nopt/32 + ASLTS_ASLFLAGS="-oa -r 1" +endif +ifeq ("$(ASLTS_MODE)", "n64") + ASLTS_AMLDIR=nopt/64 + ASLTS_ASLFLAGS="-oa -r 2" +endif +ifeq ("$(ASLTS_MODE)", "o32") + ASLTS_AMLDIR=opt/32 + ASLTS_ASLFLAGS="-r 1" +endif +ifeq ("$(ASLTS_MODE)", "o64") + ASLTS_AMLDIR=opt/64 + ASLTS_ASLFLAGS="-r 2" +endif +endif + 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" @@ -44,123 +60,115 @@ empty_all: FORCE # Rule to create directories located into aslts/tmp/aml; # aslversion is determined dynamically. -${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/%}: +$(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR): @$(INST.dir) # Make-install one particular Test Case for all modes -install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/%} +install_all_modes_of_test_case: $(TOP)/tmp/aml/$(aslversion)/$(ASLTS_AMLDIR) @rval=0; \ if [ -f "$(ASL)" ]; then \ dd=`pwd`; \ echo "---- Test path: $$dd" >> $(COMPILER_LOG); \ echo "---- Test path: $$dd" >> $(COMPILER_ERROR_LOG); \ >&2 echo "Test path: $$dd"; \ - for i in ${SETOF_INDEXES}; do \ - set -- $(SETOF_AMLDIRS); \ - shift $$i; \ - CUR_AMLDIR=$$1; \ - set -- $(SETOF_ASLFAGS); \ - shift $$i; \ - CUR_ASLFLAGS=$$1; \ - echo "---- Test type: $$CUR_AMLDIR (Flags $(COMMON_ASL_FLAGS) $$CUR_ASLFLAGS $(ADD_ASLFLAGS))" >> $(COMPILER_LOG); \ - echo "---- Test type: $$CUR_AMLDIR (Flags $(COMMON_ASL_FLAGS) $$CUR_ASLFLAGS $(ADD_ASLFLAGS))" >> $(COMPILER_ERROR_LOG); \ - for j in ${AMLMOD}; do \ - rm -f $$j.aml; \ - done; \ - for j in ${ASLMOD} $(ASLMODADD); do \ - echo "---- Compile: $$j.asl" >> $(COMPILER_LOG); \ - >&2 printf "%-18s" " Type: $$CUR_AMLDIR "; \ - >&2 printf "Compile"; \ - "$(ASL)" $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ - ret=$$?; \ - echo "" >> $(COMPILER_LOG); \ - if [ $(OPT) -eq 0 ] && [ "x$(ADD_ASLFLAGS)" != "x-f" ]; then \ - for k in ${AMLMOD}; do \ - >&2 printf " => Compile Ext in-place"; \ - "$(ASL)" -p $$k-extInPlace -oE $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ - if [ ! -f $$k-extInPlace.aml ]; then \ - >&2 printf " [[ Error: disassembly failed of $$k.aml failed ]]\n"; \ - >&2 printf " Flags used: -p $$k-aslminus -oE -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl\n\n"; \ - #exit 1; \ - fi; \ - >&2 printf " => Disassemble"; \ - echo "---- Diasassemble: $$k.aml" >> $(COMPILER_LOG); \ - echo "---- Diasassemble: $$k.aml" >> $(COMPILER_ERROR_LOG); \ - "$(ASL)" -p $$k-aslminus -oe -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl $$k-extInPlace.aml >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ - if [ ! -f $$k-aslminus.dsl ]; then \ - >&2 printf " [[ Error: disassembly failed of $$k.aml failed ]]\n"; \ - >&2 printf " Flags used: -p $$k-aslminus -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl\n\n"; \ - #exit 1; \ - fi; \ - >&2 printf " => Recompile"; \ - echo "---- Recompile: $$k.dsl" >> $(COMPILER_LOG); \ - echo "---- Recompile: $$k.dsl" >> $(COMPILER_ERROR_LOG); \ - "$(ASL)" $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$k-aslminus.dsl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ - if [ ! -f $$k-aslminus.aml ]; then \ - >&2 printf " [[ Error: re-compilation of $$k-aslminus.dsl failed]]\n"; \ - >&2 printf " Flags used: $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS)\n\n"; \ + echo "---- Test type: $(ASLTS_AMLDIR) (Flags $(COMMON_ASL_FLAGS) $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS))" >> $(COMPILER_LOG); \ + echo "---- Test type: $(ASLTS_AMLDIR) (Flags $(COMMON_ASL_FLAGS) $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS))" >> $(COMPILER_ERROR_LOG); \ + for j in ${AMLMOD}; do \ + rm -f $$j.aml; \ + done; \ + for j in ${ASLMOD} $(ASLMODADD); do \ + echo "---- Compile: $$j.asl" >> $(COMPILER_LOG); \ + >&2 printf "%-18s" " Type: $(ASLTS_AMLDIR) "; \ + >&2 printf "Compile"; \ + "$(ASL)" $(ASLTS_ASLFLAGS) "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ + ret=$$?; \ + echo "" >> $(COMPILER_LOG); \ + if [ $(OPT) -eq 0 ] && [ "x$(ADD_ASLFLAGS)" != "x-f" ]; then \ + for k in ${AMLMOD}; do \ + >&2 printf " => Compile Ext in-place"; \ + "$(ASL)" -p $$k-extInPlace -oE $(ASLTS_ASLFLAGS) "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ + if [ ! -f $$k-extInPlace.aml ]; then \ + >&2 printf " [[ Error: disassembly failed of $$k.aml failed ]]\n"; \ + >&2 printf " Flags used: -p $$k-aslminus -oE -cr -vs $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS) -od -dl\n\n"; \ + #exit 1; \ + fi; \ + >&2 printf " => Disassemble"; \ + echo "---- Diasassemble: $$k.aml" >> $(COMPILER_LOG); \ + echo "---- Diasassemble: $$k.aml" >> $(COMPILER_ERROR_LOG); \ + "$(ASL)" -p $$k-aslminus -oe -cr -vs $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS) -od -dl $$k-extInPlace.aml >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ + if [ ! -f $$k-aslminus.dsl ]; then \ + >&2 printf " [[ Error: disassembly failed of $$k.aml failed ]]\n"; \ + >&2 printf " Flags used: -p $$k-aslminus -cr -vs $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS) -od -dl\n\n"; \ + #exit 1; \ + fi; \ + >&2 printf " => Recompile"; \ + echo "---- Recompile: $$k.dsl" >> $(COMPILER_LOG); \ + echo "---- Recompile: $$k.dsl" >> $(COMPILER_ERROR_LOG); \ + "$(ASL)" $(ASLTS_ASLFLAGS) "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$k-aslminus.dsl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ + if [ ! -f $$k-aslminus.aml ]; then \ + >&2 printf " [[ Error: re-compilation of $$k-aslminus.dsl failed]]\n"; \ + >&2 printf " Flags used: $(ASLTS_ASLFLAGS) "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS)\n\n"; \ + #exit 1; \ + fi; \ + if [ $(ASLTS_AMLDIR) = "nopt/32" ] || [ $(ASLTS_AMLDIR) = "nopt/64" ]; then \ + >&2 printf " => Binary compare"; \ + rm -f comparison_output.txt; \ + acpibin -c $$k.aml $$k-aslminus.aml >> comparison_output.txt; \ + if [ $$? != 0 ]; then \ + >&2 printf " [[ Error: comparison of $$k.aml and $$k-aslminus.aml do not match ]]"; \ + cat comparison_output.txt | sed '1,/^Error/d' | sed 's/Error - Byte mismatch at offset / => /g' | sed -n 1,10p > comparison_output.txt;\ + >&2 printf "\n"; \ + cat comparison_output.txt >&2 ; \ + >&2 printf " "; \ #exit 1; \ + else \ + >&2 printf " => Success!"; \ + rm comparison_output.txt; \ fi; \ - if [ $$CUR_AMLDIR = "nopt/32" ] || [ $$CUR_AMLDIR = "nopt/64" ]; then \ - >&2 printf " => Binary compare"; \ - rm -f comparison_output.txt; \ - acpibin -c $$k.aml $$k-aslminus.aml >> comparison_output.txt; \ - if [ $$? != 0 ]; then \ - >&2 printf " [[ Error: comparison of $$k.aml and $$k-aslminus.aml do not match ]]"; \ - cat comparison_output.txt | sed '1,/^Error/d' | sed 's/Error - Byte mismatch at offset / => /g' | sed -n 1,10p > comparison_output.txt;\ - >&2 printf "\n"; \ - cat comparison_output.txt >&2 ; \ - >&2 printf " "; \ - #exit 1; \ - else \ - >&2 printf " => Success!"; \ - rm comparison_output.txt; \ - fi; \ - fi; \ - if [ ! -f comparison_output.txt ]; then \ - >&2 printf " => Removing files"; \ - rm $$k-aslminus.lst; \ - rm $$k-aslminus.aml; \ - rm $$k-aslminus.dsl; \ - fi; \ - for n in "$$k-aslminus" "$$k-extInPlace"; do \ - rm $$n.i $$n.asm $$n.nsp; \ - rm $$n.c $$n.hex $$n.map; \ - rm $$n.h $$n.src $$n.offset.h; \ - done; \ - rm $$k-extInPlace.aml; \ - rm $$k-extInPlace.lst; \ - >&2 printf " => Done"; \ + fi; \ + if [ ! -f comparison_output.txt ]; then \ + >&2 printf " => Removing files"; \ + rm $$k-aslminus.lst; \ + rm $$k-aslminus.aml; \ + rm $$k-aslminus.dsl; \ + fi; \ + for n in "$$k-aslminus" "$$k-extInPlace"; do \ + rm $$n.i $$n.asm $$n.nsp; \ + rm $$n.c $$n.hex $$n.map; \ + rm $$n.h $$n.src $$n.offset.h; \ done; \ - fi; \ - >&2 printf " => Removing files"; \ - rm $$j.asm; \ - rm $$j.c; \ - rm $$j.h; \ - rm $$j.i; \ - rm $$j.hex; \ - rm $$j.lst; \ - rm $$j.map; \ - rm $$j.nsp; \ - rm $$j.offset.h; \ - rm $$j.src; \ - >&2 printf " => Done"; \ - if [ $$ret != 0 ]; then \ - rval=1; \ - >&2 echo "**** Unexpected iASL failure in $$dd/$$j.asl!"; \ - exit 1; \ - fi; \ - done; \ - >&2 echo ""; \ - 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)/$$CUR_AMLDIR" >> $(COMPILER_LOG); \ - mv $$j.aml $(TOP)/tmp/aml/$(aslversion)/$$CUR_AMLDIR; \ - ret=$$?; \ - if [ $$ret != 0 ]; then rval=2; echo "**** mv failed!" >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); break; fi; \ - done; \ + rm $$k-extInPlace.aml; \ + rm $$k-extInPlace.lst; \ + >&2 printf " => Done"; \ + done; \ + fi; \ + >&2 printf " => Removing files"; \ + rm $$j.asm; \ + rm $$j.c; \ + rm $$j.h; \ + rm $$j.i; \ + rm $$j.hex; \ + rm $$j.lst; \ + rm $$j.map; \ + rm $$j.nsp; \ + rm $$j.offset.h; \ + rm $$j.src; \ + >&2 printf " => Done"; \ + if [ $$ret != 0 ]; then \ + rval=1; \ + >&2 echo "**** Unexpected iASL failure in $$dd/$$j.asl!"; \ + exit 1; \ + fi; \ + done; \ + >&2 echo ""; \ + 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); \ + ret=$$?; \ + if [ $$ret != 0 ]; then rval=2; echo "**** mv failed!" >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); break; fi; \ done; \ else \ echo "Bad iASL 0: <$(ASL)> does not exist"; \ @@ -219,7 +227,7 @@ install_test_case: echo "Bad dir: aslts/tmp"; exit 1; \ else \ cd "$$testcasedir"; \ - export aslversion; make install_all_modes_of_test_case OPT=$(OPT); \ + export aslversion; make install_all_modes_of_test_case ASLTS_MODE=$(ASLTS_MODE) OPT=$(OPT); \ fi; \ fi; \ fi; \ @@ -238,18 +246,10 @@ compile_test_case: echo "Compile_test_case" if [ -f "$(ASL)" ]; then \ - for i in ${SETOF_INDEXES}; do \ - set -- $(SETOF_AMLDIRS); \ - shift $$i; \ - CUR_AMLDIR=$$1; \ - set -- $(SETOF_ASLFAGS); \ - shift $$i; \ - CUR_ASLFLAGS=$$1; \ - for j in ${ASLMOD} $(ASLMODADD); do \ - "$(ASL)" $$CUR_ASLFLAGS $(ADD_ASLFLAGS) $$j.asl; \ - ret=$$?; \ - if [ $$ret != 0 ]; then rval=1; echo "**** Unexpected iASL failure!"; exit 1; fi; \ - done; \ + for j in ${ASLMOD} $(ASLMODADD); do \ + "$(ASL)" $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS) $$j.asl; \ + ret=$$?; \ + if [ $$ret != 0 ]; then rval=1; echo "**** Unexpected iASL failure!"; exit 1; fi; \ done; \ else \ echo "Bad iASL 4: <$(ASL)> does not exist"; \ diff --git a/tests/aslts/Makefile.switch b/tests/aslts/Makefile.switch index 04fcbc3c4..981694b0d 100644 --- a/tests/aslts/Makefile.switch +++ b/tests/aslts/Makefile.switch @@ -12,19 +12,29 @@ install: FORCE else \ pwd; \ >&2 echo "Begin compiling test package: [$$d]"; \ - if ($(MAKE) install); then \ - :; \ - else \ + $(MAKE) install ASLTS_MODE=$(ASLTS_MODE); \ + if [ $$? -ne 0 ]; then \ r=1; \ false; \ fi; \ fi); \ - if [ $$r -ne 0 ]; then \ - exit $r; \ - fi; \ - >&2 echo "Compiled test package: [$$d]"; \ + if [ $$r -ne 0 ]; then \ + exit $r; \ + fi; \ + >&2 echo "Compiled test package: [$$d]"; \ done +install_n32: + $(MAKE) install ASLTS_MODE=n32 +install_n64: + $(MAKE) install ASLTS_MODE=n64 +install_o32: + $(MAKE) install ASLTS_MODE=o32 +install_o64: + $(MAKE) install ASLTS_MODE=o64 + +install_all: install_n32 install_n64 install_o32 install_o64 + clean: FORCE @for d in ${MDIRS}; do \ (cd $$d; \ diff --git a/tests/aslts/bin/Do b/tests/aslts/bin/Do index b85a91f84..17e5ad5be 100755 --- a/tests/aslts/bin/Do +++ b/tests/aslts/bin/Do @@ -297,21 +297,26 @@ do_bdemo_table() make_target() { - local dir restore_dir + local dir restore_dir mode options restore_dir=$PWD target=$1 dir="$2" execonly=$3 + mode=$4 cd "$dir" echo "Running make $target from $dir" if [ "$execonly" = "yes" ]; then - make $target OPT=1 > /dev/null + options="OPT=1" else - make $target OPT=0 > /dev/null + options="OPT=0" fi + if [ ! -z $mode ]; then + options="$options ASLTS_MODE=$mode" + fi + make $target $options > /dev/null res=$? cd "$restore_dir" @@ -320,7 +325,43 @@ make_target() make_install() { - make_target install "$1" "$2" + local res=0 nres=0 + + echo $1 $2 $ENABLENORM32 + if [ $ENABLENORM32 != 0 ]; then + echo "Make n32" + make_target install "$1" "$2" "n32" + nres=$? + if [ $nres -ne 0 ]; then + res=$nres + fi + fi + if [ $ENABLENORM64 != 0 ]; then + echo "Make n64" + make_target install "$1" "$2" "n64" + nres=$? + if [ $nres -ne 0 ]; then + res=$nres + fi + fi + if [ $ENABLEOPT32 != 0 ]; then + echo "Make s32" + make_target install "$1" "$2" "o32" + nres=$? + if [ $nres -ne 0 ]; then + res=$nres + fi + fi + if [ $ENABLEOPT64 != 0 ]; then + echo "Make s64" + make_target install "$1" "$2" "o64" + nres=$? + if [ $nres -ne 0 ]; then + res=$nres + fi + fi + + return $res } # Make-install all the provided test cases @@ -459,6 +500,16 @@ run_asl_compiler() local nparam=$2 list="$3" execonly=$4 local action=100 + # It's better to split this function into a special 'asltscomp' + # script. For now, still uses it as an inline function. + RESET_SETTINGS + INIT_ALL_AVAILABLE_CASES + INIT_ALL_AVAILABLE_MODES + INIT_SET_OF_TEST_CASES + INIT_SET_OF_TEST_MODES + INIT_LOG_RESULTS + INIT_MEM_STAT + if [ $nparam -le 1 ]; then usage do_exit 1 "Bad parameters 0" |