testsuite: move architecture-specific logic from tests/asmgen to tools

master
Sébastien Hinderer 2018-04-26 10:21:31 +02:00
parent 3c98b3cb9c
commit 65090a836f
9 changed files with 20 additions and 14 deletions

View File

@ -22,9 +22,7 @@ default:
$(MAKE) all; \
fi
all:
@$(MAKE) arch
@$(MAKE) tests
all: tests
CASES=fib tak quicksort quicksort2 soli \
arith checkbound tagged-fib tagged-integr tagged-quicksort tagged-tak \
@ -52,16 +50,17 @@ skips:
echo " ... testing '$$c': => skipped"; \
done
include $(BASEDIR)/makefiles/Makefile.common
archmod = $(OTOPDIR)/testsuite/tools/asmgen_$(ARCH).$(O)
one:
@$(call CCOMP,$(NAME).out $(ARGS_$(NAME)) $(NAME).$(O) $(ARCH).$(O)) \
@$(call CCOMP,$(NAME).out $(ARGS_$(NAME)) $(NAME).$(O) $(archmod)) \
&& echo " => passed" || echo " => failed"
clean: defaultclean
@rm -f *.out *.out.manifest *.$(O) *.exe
@rm -f $(CASES:=.s)
include $(BASEDIR)/makefiles/Makefile.common
ifeq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64"
# these tests are not ported to MSVC64 yet
SKIP=true
@ -86,9 +85,3 @@ tests: $(CASES:=.$(O))
done
promote:
arch: $(ARCH).$(O)
i386.obj: i386nt.asm
@set -o pipefail ; \
$(ASM) $@ $^ | tail -n +2

View File

@ -13,6 +13,7 @@
#**************************************************************************
BASEDIR=..
include $(BASEDIR)/../config/Makefile
expect_MAIN=expect_test
expect_PROG=$(expect_MAIN)$(EXE)
expect_COMPFLAGS=-I $(OTOPDIR)/parsing -I $(OTOPDIR)/utils \
@ -37,10 +38,18 @@ codegen_OBJECTS=parsecmmaux.cmo parsecmm.cmo lexcmm.cmo codegen_main.cmo
codegen_ADD_COMPFLAGS=$(codegen_INCLUDES) -w -40 -g
all: $(expect_PROG) codegen
ifeq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64"
# The asmgen tests are not ported to MSVC64 yet
# so do not compile any arch-specific module
arch_target :=
else
arch_target := asmgen_$(ARCH).$(O)
endif
all: $(expect_PROG) codegen $(arch_target)
$(expect_PROG): $(expect_LIBRARIES:=.cma) $(expect_MAIN).cmo
$(OCAMLC) -linkall -o $@ $^
@$(OCAMLC) -linkall -o $@ $^
include $(BASEDIR)/makefiles/Makefile.common
@ -64,3 +73,7 @@ parsecmm.mli parsecmm.ml: parsecmm.mly
lexcmm.ml: lexcmm.mll
@$(OCAMLLEX) -q lexcmm.mll
asmgen_i386.obj: asmgen_i386nt.asm
@set -o pipefail ; \
$(ASM) $@ $^ | tail -n +2