@@ -810,71 +810,100 @@ else
810810ABCOPT =""
811811endif
812812
813- # When YOSYS_NOVERIFIC is set as a make variable, also export it to the
814- # enviornment, so that `YOSYS_NOVERIFIC=1 make test` _and_
815- # `make test YOSYS_NOVERIFIC=1` will run with verific disabled.
816- ifeq ($(YOSYS_NOVERIFIC ) ,1)
817- export YOSYS_NOVERIFIC
818- endif
819-
820- test : $(TARGETS ) $(EXTRA_TARGETS )
813+ # Tests that generate .mk with tests/gen-tests-makefile.sh
814+ MK_TEST_DIRS =
815+ MK_TEST_DIRS += tests/arch/anlogic
816+ MK_TEST_DIRS += tests/arch/ecp5
817+ MK_TEST_DIRS += tests/arch/efinix
818+ MK_TEST_DIRS += tests/arch/gatemate
819+ MK_TEST_DIRS += tests/arch/gowin
820+ MK_TEST_DIRS += tests/arch/ice40
821+ MK_TEST_DIRS += tests/arch/intel_alm
822+ MK_TEST_DIRS += tests/arch/machxo2
823+ MK_TEST_DIRS += tests/arch/microchip
824+ MK_TEST_DIRS += tests/arch/nanoxplore
825+ MK_TEST_DIRS += tests/arch/nexus
826+ MK_TEST_DIRS += tests/arch/quicklogic/pp3
827+ MK_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f
828+ MK_TEST_DIRS += tests/arch/xilinx
829+ MK_TEST_DIRS += tests/opt
830+ MK_TEST_DIRS += tests/sat
831+ MK_TEST_DIRS += tests/sim
832+ MK_TEST_DIRS += tests/svtypes
833+ MK_TEST_DIRS += tests/techmap
834+ MK_TEST_DIRS += tests/various
821835ifeq ($(ENABLE_VERIFIC ) ,1)
822- ifeq ($(YOSYS_NOVERIFIC ) ,1)
823- @echo
824- @echo "Running tests without verific support due to YOSYS_NOVERIFIC=1"
825- @echo
826- else
827- +cd tests/verific && bash run-test.sh $(SEEDOPT)
828- endif
829- endif
830- +cd tests/simple && bash run-test.sh $(SEEDOPT)
831- +cd tests/simple_abc9 && bash run-test.sh $(SEEDOPT)
832- +cd tests/hana && bash run-test.sh $(SEEDOPT)
833- +cd tests/asicworld && bash run-test.sh $(SEEDOPT)
834- # +cd tests/realmath && bash run-test.sh $(SEEDOPT)
835- +cd tests/share && bash run-test.sh $(SEEDOPT)
836- +cd tests/opt_share && bash run-test.sh $(SEEDOPT)
837- +cd tests/fsm && bash run-test.sh $(SEEDOPT)
838- +cd tests/techmap && bash run-test.sh
839- +cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
840- +cd tests/memlib && bash run-test.sh $(SEEDOPT)
841- +cd tests/bram && bash run-test.sh $(SEEDOPT)
842- +cd tests/various && bash run-test.sh
843- +cd tests/select && bash run-test.sh
844- +cd tests/sat && bash run-test.sh
845- +cd tests/sim && bash run-test.sh
846- +cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
847- +cd tests/svtypes && bash run-test.sh $(SEEDOPT)
848- +cd tests/proc && bash run-test.sh
849- +cd tests/blif && bash run-test.sh
850- +cd tests/opt && bash run-test.sh
851- +cd tests/aiger && bash run-test.sh $(ABCOPT)
852- +cd tests/arch && bash run-test.sh
853- +cd tests/arch/ice40 && bash run-test.sh $(SEEDOPT)
854- +cd tests/arch/xilinx && bash run-test.sh $(SEEDOPT)
855- +cd tests/arch/ecp5 && bash run-test.sh $(SEEDOPT)
856- +cd tests/arch/machxo2 && bash run-test.sh $(SEEDOPT)
857- +cd tests/arch/efinix && bash run-test.sh $(SEEDOPT)
858- +cd tests/arch/anlogic && bash run-test.sh $(SEEDOPT)
859- +cd tests/arch/gowin && bash run-test.sh $(SEEDOPT)
860- +cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
861- +cd tests/arch/nanoxplore && bash run-test.sh $(SEEDOPT)
862- +cd tests/arch/nexus && bash run-test.sh $(SEEDOPT)
863- +cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT)
864- +cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT)
865- +cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT)
866- +cd tests/arch/microchip && bash run-test.sh $(SEEDOPT)
867- +cd tests/rpc && bash run-test.sh
868- +cd tests/memfile && bash run-test.sh
869- +cd tests/verilog && bash run-test.sh
870- +cd tests/xprop && bash run-test.sh $(SEEDOPT)
871- +cd tests/fmt && bash run-test.sh
872- +cd tests/cxxrtl && bash run-test.sh
836+ ifneq ($(YOSYS_NOVERIFIC ) ,1)
837+ MK_TEST_DIRS += tests/verific
838+ endif
839+ endif
840+ MK_TEST_DIRS += tests/verilog
841+
842+ # Tests that don't generate .mk
843+ SH_TEST_DIRS =
844+ SH_TEST_DIRS += tests/simple
845+ SH_TEST_DIRS += tests/simple_abc9
846+ SH_TEST_DIRS += tests/hana
847+ SH_TEST_DIRS += tests/asicworld
848+ # SH_TEST_DIRS += tests/realmath
849+ SH_TEST_DIRS += tests/share
850+ SH_TEST_DIRS += tests/opt_share
851+ SH_TEST_DIRS += tests/fsm
852+ SH_TEST_DIRS += tests/memlib
853+ SH_TEST_DIRS += tests/bram
854+ SH_TEST_DIRS += tests/svinterfaces
855+ SH_TEST_DIRS += tests/xprop
856+ SH_TEST_DIRS += tests/select
857+ SH_TEST_DIRS += tests/proc
858+ SH_TEST_DIRS += tests/blif
859+ SH_TEST_DIRS += tests/arch
860+ SH_TEST_DIRS += tests/rpc
861+ SH_TEST_DIRS += tests/memfile
862+ SH_TEST_DIRS += tests/fmt
863+ SH_TEST_DIRS += tests/cxxrtl
873864ifeq ($(ENABLE_FUNCTIONAL_TESTS ) ,1)
874- +cd tests/functional && bash run-test.sh
875- endif
865+ SH_TEST_DIRS += tests/functional
866+ endif
867+
868+ # Tests that don't generate .mk and need special args
869+ SH_ABC_TEST_DIRS =
870+ SH_ABC_TEST_DIRS += tests/memories
871+ SH_ABC_TEST_DIRS += tests/aiger
872+
873+ # seed-tests/ is a dummy string, not a directory
874+ .PHONY : seed-tests
875+ seed-tests : $(SH_TEST_DIRS:%=seed-tests/% )
876+ .PHONY : seed-tests/%
877+ seed-tests/% : % /run-test.sh $(TARGETS ) $(EXTRA_TARGETS )
878+ +cd $* && bash run-test.sh $(SEEDOPT )
879+ +@echo " ...passed tests in $* "
880+
881+ # abcopt-tests/ is a dummy string, not a directory
882+ .PHONY : abcopt-tests
883+ abcopt-tests : $(SH_ABC_TEST_DIRS:%=abcopt-tests/% )
884+ abcopt-tests/% : % /run-test.sh $(TARGETS ) $(EXTRA_TARGETS )
885+ +cd $* && bash run-test.sh $(ABCOPT ) $(SEEDOPT )
886+ +@echo " ...passed tests in $* "
887+
888+ # makefile-tests/ is a dummy string, not a directory
889+ .PHONY : makefile-tests
890+ makefile-tests : $(MK_TEST_DIRS:%=makefile-tests/% )
891+ # this target actually emits .mk files
892+ % .mk :
893+ +cd $(dir $* ) && bash run-test.sh
894+ # this one spawns submake on each
895+ makefile-tests/% : % /run-test.mk $(TARGETS ) $(EXTRA_TARGETS )
896+ $(MAKE ) -C $* -f run-test.mk
897+ +@echo " ...passed tests in $* "
898+
899+ test : makefile-tests abcopt-tests seed-tests
876900 @echo " "
877901 @echo " Passed \" make test\" ."
902+ ifeq ($(ENABLE_VERIFIC ) ,1)
903+ ifeq ($(YOSYS_NOVERIFIC ) ,1)
904+ @echo " Ran tests without verific support due to YOSYS_NOVERIFIC=1."
905+ endif
906+ endif
878907 @echo ""
879908
880909VALGRIND ?= valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all
0 commit comments