Merge pull request #305 from SchmErik/aslts_makefile_cleanup

ASLTS script clean up
This commit is contained in:
Robert Moore 2017-08-31 08:51:08 -07:00 committed by GitHub
commit 82f676f946
5 changed files with 401 additions and 261 deletions

View File

@ -116,16 +116,14 @@ run_aslts() {
version=`$ASL | grep version | awk '{print $5}'`
rm -rf $ASLTSDIR/tmp/aml/$version
if [ "x$TEST_CASES" = "x" ]; then
# Compile all ASL test modules
Do 0 aslts $EXECONLY
if [ "x$TEST_MODES" = "x" ]; then
TEST_MODES="n32 n64 o32 o64"
fi
Do 0 $TEST_MODES $TEST_CASES $EXECONLY
if [ $? -ne 0 ]; then
echo "ASLTS Compile Failure"
exit 1
fi
else
Do 0 $TEST_CASES $EXECONLY
fi
# Execute the test suite
if [ "x$BINCOMPONLY" = "xno" ]; then

View File

@ -22,13 +22,39 @@
# 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"
COMMON_ASL_FLAGS= "-of -cr -vs -l -sc -sa -ic -ta -ts -so -lm -ln -ls -li"
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
ifeq ("$(ASLTS_MODE)", "aslminus")
ASLTS_AMLDIR=aslminus/
ASLTS_ASLFLAGS="-oa -r 2"
endif
ifeq ("$(ASLTS_MODE)", "aslplus")
ASLTS_AMLDIR=aslplus/
ASLTS_ASLFLAGS="-oa -r 2"
endif
endif
ASLTS_VER ?= $(ASLTS_VER)
COMPILER_LOG="$(TOP)/tmp/aml/$(aslversion)/compile.txt"
COMPILER_ERROR_LOG="$(TOP)/tmp/aml/$(aslversion)/error.txt"
COMMON_NO_OUTPUT_ASL_FLAGS= "-of -cr -vs"
COMMON_ASL_FLAGS= $(COMMON_NO_OUTPUT_ASL_FLAGS)" -l -sc -sa -ic -ta -ts -so -lm -ln -ls -li"
COMPILER_LOG="$(TOP)/tmp/aml/$(ASLTS_VER)/compile.txt"
COMPILER_ERROR_LOG="$(TOP)/tmp/aml/$(ASLTS_VER)/error.txt"
# Create general directory
@ -42,98 +68,31 @@ ASLMOD= MAIN
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/$(ASLTS_VER)/$(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/$(ASLTS_VER)/$(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); \
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: $$CUR_AMLDIR "; \
>&2 printf "%-18s" " Type: $(ASLTS_AMLDIR) "; \
>&2 printf "Compile"; \
"$(ASL)" $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \
"$(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 $$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"; \
#exit 1; \
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"; \
done; \
fi; \
>&2 printf " => Removing files"; \
rm $$j.asm; \
rm $$j.c; \
@ -156,12 +115,11 @@ install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/%
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; \
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; \
done; \
else \
echo "Bad iASL 0: <$(ASL)> does not exist"; \
rval=1; \
@ -169,66 +127,78 @@ install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/%
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; \
fi; \
if [ "$(ASLTS_MODE)" = "aslminus" ]; then \
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); \
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 OPT=$(OPT); \
fi; \
fi; \
fi; \
fi; \
fi; \
fi; \
fi; \
make install_all_modes_of_test_case ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
fi
TEST_SEQUENCE_ASL_FLAGS="$(ASLTS_ASLFLAGS) $(COMMON_NO_OUTPUT_ASL_FLAGS) $(ADD_ASLFLAGS)"
disasm_test_compile: $(TOP)/tmp/aml/$(ASLTS_VER)/$(ASLTS_AMLDIR)
@rval=0; \
for j in ${ASLMOD} $(ASLMODADD); do \
for k in ${AMLMOD}; do \
>&2 printf " => Compile Ext in-place"; \
"$(ASL)" -p $$k-extInPlace -oE $(TEST_SEQUENCE_ASL_FLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \
ret=$$?; \
if [ $$ret != 0 ]; then \
rval=2; \
>&2 printf " [[ Error: compiling $$k.aml with externals in place failed ]]\n"; \
>&2 printf " Flags used: -p $$k-extInPlace -oE $(TEST_SEQUENCE_ASL_FLAGS)\n\n"; \
fi; \
done; \
done; \
if [ $$rval != 0 ]; then exit 1; fi
disasm_test_disassemble: disasm_test_compile
@rval=0; \
for k in ${AMLMOD}; do \
>&2 printf " => Disassemble"; \
"$(ASL)" -p $$k -oe -od $(COMMON_NO_OUTPUT_ASL_FLAGS) $(ADD_ASLFLAGS) $(DISASM_FLAG) $$k-extInPlace.aml >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \
ret=$$?; \
if [ $$ret != 0 ]; then \
retval=2; \
>&2 printf " [[ Error: disassembly of $$k-extInPlace.aml failed ]]\n"; \
>&2 printf " Flags used: -oe -od $(COMMON_NO_OUTPUT_ASL_FLAGS) $(ADD_ASLFLAGS) $(DISASM_FLAG)\n\n"; \
fi; \
done; \
if [ $$rval != 0 ]; then exit 1; fi
disasm_test_recompile: disasm_test_disassemble
@rval=0; \
for k in ${AMLMOD}; do \
>&2 printf " => Recompile\n"; \
"$(ASL)" $(TEST_SEQUENCE_ASL_FLAGS) $$k.dsl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \
ret=$$?; \
if [ $$ret != 0 ]; then \
rval=2; \
>&2 printf " [[ Error: re-compilation of $$k-$$l.dsl failed]]\n"; \
>&2 printf " Flags used: $(TEST_SEQUENCE_ASL_FLAGS)\n\n"; \
fi; \
rm $$k.dsl; \
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; \
install_disasm_test_case:
if [ "x$(ADD_ASLFLAGS)" != "x-f" ]; then \
make disasm_test_recompile; \
make clean; \
else \
>&2 echo "Skipping disassembler test for this test case"; \
fi;
# Compile one particular Test Case for all modes.
# No moving results to aslts/tmp/aml directory.
@ -238,19 +208,11 @@ 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; \
"$(ASL)" $(ASLTS_ASLFLAGS) $(ADD_ASLFLAGS) $$j.asl; \
ret=$$?; \
if [ $$ret != 0 ]; then rval=1; echo "**** Unexpected iASL failure!"; exit 1; fi; \
done; \
done; \
else \
echo "Bad iASL 4: <$(ASL)> does not exist"; \
rval=1; \

View File

@ -1,5 +1,7 @@
# common switch make
ASLTS_VER ?= 00000000
all: ${MDIRS}
${MDIRS}: FORCE
@cd $@; pwd; make
@ -12,9 +14,8 @@ install: FORCE
else \
pwd; \
>&2 echo "Begin compiling test package: [$$d]"; \
if ($(MAKE) install); then \
:; \
else \
$(MAKE) install ASLTS_MODE=$(ASLTS_MODE) ASLTS_VER=$(ASLTS_VER); \
if [ $$? -ne 0 ]; then \
r=1; \
false; \
fi; \
@ -25,6 +26,21 @@ install: FORCE
>&2 echo "Compiled test package: [$$d]"; \
done
install_n32:
$(MAKE) install ASLTS_MODE=n32 ASLTS_VER=$(ASLTS_VER)
install_n64:
$(MAKE) install ASLTS_MODE=n64 ASLTS_VER=$(ASLTS_VER)
install_o32:
$(MAKE) install ASLTS_MODE=o32 ASLTS_VER=$(ASLTS_VER)
install_o64:
$(MAKE) install ASLTS_MODE=o64 ASLTS_VER=$(ASLTS_VER)
install_aslminus:
$(MAKE) install ASLTS_MODE=aslminus ASLTS_VER=$(ASLTS_VER)
install_aslplus:
$(MAKE) install ASLTS_MODE=aslplus ASLTS_VER=$(ASLTS_VER)
install_all: install_n32 install_n64 install_o32 install_o64 install_aslminus install_aslplus
clean: FORCE
@for d in ${MDIRS}; do \
(cd $$d; \

View File

@ -295,31 +295,138 @@ do_bdemo_table()
bdemostabs "$DIR0" "$DIR1" "$ALLBUGS" "$KBSUM" "$LBSUM" "$BUG_STATE_DIR"
}
make_target()
{
local dir restore_dir mode options aslversion
restore_dir=$PWD
target=$1
dir="$2"
mode=$3
aslversion=`get_iasl_version`
cd "$dir"
echo "Running make $target from $dir"
options="ASLTS_VER=$aslversion"
if [ ! -z $mode ]; then
options="$options ASLTS_MODE=$mode"
fi
make $target $options > /dev/null
res=$?
cd "$restore_dir"
return $res
}
binary_compare()
{
mode=$1
aslversion=`get_iasl_version`
disasm_compile_dir="$ASLTSDIR/tmp/aml/$aslversion/$mode"
normal_compile_dir="$ASLTSDIR/tmp/aml/$aslversion/nopt/64"
if [ ! -d $disasm_compile_dir ]; then
echo "$dism_compile_dir does not exist. Aborting binary compare"
return;
fi
if [ ! -d $normal_compile_dir ]; then
echo "$normal_compile_dir does not exist. Aborting binary compare"
return;
fi
for f in $disasm_compile_dir/*
do
filename=`basename $f`
acpibin -a "$f" "$normal_compile_dir/$filename" > /dev/null
if [ $? -ne 0 ]; then
echo "[[ Error: $mode Binary compare for $filename failed ]]"
else
echo "$mode Binary compare for $filename passed"
fi
done
}
make_install()
{
local res=0 nres=0
execonly=$2
if [ $ENABLENORM32 != 0 ]; then
echo "Make n32"
make_target install "$1" "n32"
nres=$?
if [ $nres -ne 0 ]; then
res=$nres
fi
fi
if [ $ENABLENORM64 != 0 ]; then
echo "Make n64"
make_target install "$1" "n64"
nres=$?
if [ $nres -ne 0 ]; then
res=$nres
fi
fi
if [ $ENABLEOPT32 != 0 ]; then
echo "Make s32"
make_target install "$1" "o32"
nres=$?
if [ $nres -ne 0 ]; then
res=$nres
fi
fi
if [ $ENABLEOPT64 != 0 ]; then
echo "Make s64"
make_target install "$1" "o64"
nres=$?
if [ $nres -ne 0 ]; then
res=$nres
fi
fi
if [ "x$execonly" = "xno" ]; then
# for binary compare, we need to compare with normal 64 bit aml
# files build n64 mode normal 64 bit aml files build n64 mode
# if this test run does not include it.
if [ $ENABLENORM64 -eq 0 ]; then
echo "Make n64"
make_target install "$1" "n64"
nres=$?
if [ $nres -ne 0 ]; then
res=$nres
fi
fi
echo "Make ASL plus"
make_target install "$1" "aslplus"
nres=$?
binary_compare "aslplus"
nres=$(($nres+ $?))
if [ $nres -ne 0 ]; then
res=$nres
fi
echo "Make ASL minus"
make_target install "$1" "aslminus"
nres=$?
binary_compare "aslplus"
nres=$(($nres+ $?))
if [ $nres -ne 0 ]; then
res=$(($res + $nres))
fi
fi
return $res
}
# Make-install all the provided test cases
# (make install from aslts directory)
# arg1 - root directory of aslts
make_install_1()
{
local dir restore_dir diasm
restore_dir=$PWD
dir="$1"
execonly=$2
cd "$dir"
echo "Running make install from $dir"
if [ "$execonly" = "yes" ]; then
make install OPT=1 > /dev/null
else
make install OPT=0 > /dev/null
fi
make_install "$1" "$2"
if [ $? -ne 0 ]; then
do_exit 1 "make install error"
fi
cd "$restore_dir"
}
# Check parameters to be the names of test
@ -347,13 +454,7 @@ do_test_cases_make_install()
check_dir "$dir"
if [ $3 != 0 ]; then
cd "$dir"
if [ "x$execonly" = "xyes" ]; then
make install OPT=1 > /dev/null
else
make install OPT=0 > /dev/null
fi
make_install "$dir" "$execonly"
if [ $? -ne 0 ]; then
errors=1
fi
@ -361,8 +462,6 @@ do_test_cases_make_install()
done
cd "$restore_dir"
return $errors
}
# Make-install a list of specified test cases
@ -404,12 +503,7 @@ do_collections_make_install()
check_dir "$dir"
if [ $3 != 0 ]; then
cd "$dir"
if [ "$execonly" = "yes" ]; then
make install OPT=1 > /dev/null
else
make install OPT=0 > /dev/null
fi
make_install "$dir" "$execonly"
if [ $? -ne 0 ]; then
errors=1
fi
@ -457,36 +551,30 @@ make_install_3()
# arg3 - all parameters passed to Do utility
run_asl_compiler()
{
local lexem list nparam=$2 action=100 execonly=$4
local list="$2" execonly=$3
local action=100
lexem=`echo "$3" | awk '{ print $2}'`
# 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"
elif [ $lexem == ASLTS -o $lexem == aslts ]; then
if [ $nparam != 3 ]; then
usage
do_exit 1 "Bad parameters 1"
else
if [ $list == ASLTS -o $list == aslts ]; then
action=1
fi
elif [ $lexem == ALL -o $lexem == all ]; then
if [ $nparam -le 3 ]; then
usage
do_exit 1 "Bad parameters 2"
else
elif [ $list == ALL -o $list == all ]; then
list=`echo "$3" | cut -c 7-`
action=3
fi
else
action=2
list=`echo "$3" | cut -c 3-`
fi
# cut the last item from the list. It's a yes or no from execonly.
list=`echo $list | rev | cut -c 4- | rev `
>&2 echo "list of testcases: $list"
echo "list of testcases: $list"
if [ $action == 1 ]; then
echo "Make-install all the provided test cases"
make_install_1 "$1" "$execonly"
@ -501,6 +589,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}}' |\
@ -619,9 +729,59 @@ if [ $CMD == $ASLCOMPILE ]; then
do_exit 1 "Undefined ASL variable! Set it to pathname of ASL compiler."
fi
x="$@"
>&2 echo "disassemble: $EXECONLY"
run_asl_compiler "$ASLTSDIR" $NPARAM "$x" "$EXECONLY"
shift 1
ENABLED_TMODES=
while :
do
check_mode_id $1
if [ $? -eq 1 ]; then
break
fi
ENABLED_TMODES="$1 $ENABLED_TMODES"
shift 1
done
export ENABLED_TMODES
#NPARAM counts the number of enabled test cases
NPARAM=0
ENABLED_TCASES=
while :
do
get_collection_opcode $1
if [ $? -eq $COLLS_NUM ]; then
break
fi
ENABLED_TCASES="$1 $ENABLED_TCASES"
shift 1
NPARAM=$(($NPARAM + 1))
done
export ENABLED_TCASES
if [ "x$ENABLED_TCASES" == "x" ]; then
x=aslts
NPARAM=$(($NPARAM + 1))
else
x="$ENABLED_TCASES"
fi
if [ $NPARAM -le 0 ]; then
usage
do_exit 1 "Bad parameters 0"
elif [ $x == ASLTS -o $x == aslts ]; then
if [ $NPARAM != 1 ]; then
usage
do_exit 1 "Bad parameters 1"
fi
elif [ $x == ALL -o $x == all ]; then
if [ $NPARAM -le 0 ]; then
usage
do_exit 1 "Bad parameters 2"
fi
fi
EXECONLY=$1
run_asl_compiler "$ASLTSDIR" "$x" "$EXECONLY"
elif [ $CMD == $RUNTESTS ]; then

View File

@ -212,42 +212,46 @@ get_collection_opcode()
{
local rval=0
echo $FUNC_COLL | grep $1 > /dev/null
if [ -z $1 ]; then
return $COLLS_NUM
fi
echo $FUNC_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $FUNC_COLL_OP
fi
echo $CPLX_COLL | grep $1 > /dev/null
echo $CPLX_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $CPLX_COLL_OP
fi
echo $EXCP_COLL | grep $1 > /dev/null
echo $EXCP_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $EXCP_COLL_OP
fi
echo $BDEMO_COLL | grep $1 > /dev/null
echo $BDEMO_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $BDEMO_COLL_OP
fi
echo $SERV_COLL | grep $1 > /dev/null
echo $SERV_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $SERV_COLL_OP
fi
echo $MT_COLL | grep $1 > /dev/null
echo $MT_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $MT_COLL_OP
fi
echo $MS_IDENT_COLL | grep $1 > /dev/null
echo $MS_IDENT_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $MS_IDENT_COLL_OP
fi
echo $IMPL_COLL | grep $1 > /dev/null
echo $IMPL_COLL | grep -w $1 > /dev/null
if [ $? -eq 0 ]; then
return $IMPL_COLL_OP
fi