test: every test everywhere all at once

This commit is contained in:
Emil J. Tywoniak 2024-12-12 01:28:36 +01:00
parent e91e95f501
commit 603e5eb30a
2 changed files with 98 additions and 63 deletions

157
Makefile
View File

@ -842,69 +842,104 @@ else
ABCOPT="" ABCOPT=""
endif endif
# When YOSYS_NOVERIFIC is set as a make variable, also export it to the
# enviornment, so that `YOSYS_NOVERIFIC=1 make test` _and_ ###########################
# `make test YOSYS_NOVERIFIC=1` will run with verific disabled. # TESTS THAT GENERATE .MK #
ifeq ($(YOSYS_NOVERIFIC),1) ###########################
export YOSYS_NOVERIFIC PARALLEL_TEST_DIRS =
PARALLEL_TEST_DIRS += tests/arch/anlogic
PARALLEL_TEST_DIRS += tests/arch/ecp5
PARALLEL_TEST_DIRS += tests/arch/efinix
PARALLEL_TEST_DIRS += tests/arch/gatemate
PARALLEL_TEST_DIRS += tests/arch/gowin
PARALLEL_TEST_DIRS += tests/arch/ice40
PARALLEL_TEST_DIRS += tests/arch/intel_alm
PARALLEL_TEST_DIRS += tests/arch/machxo2
PARALLEL_TEST_DIRS += tests/arch/microchip
PARALLEL_TEST_DIRS += tests/arch/nanoxplore
PARALLEL_TEST_DIRS += tests/arch/nexus
PARALLEL_TEST_DIRS += tests/arch/quicklogic/pp3
PARALLEL_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f
PARALLEL_TEST_DIRS += tests/arch/xilinx
PARALLEL_TEST_DIRS += tests/opt
PARALLEL_TEST_DIRS += tests/sat
PARALLEL_TEST_DIRS += tests/sim
PARALLEL_TEST_DIRS += tests/svtypes
PARALLEL_TEST_DIRS += tests/techmap
PARALLEL_TEST_DIRS += tests/various
PARALLEL_TEST_DIRS += tests/verific
PARALLEL_TEST_DIRS += tests/verilog
# FIXME: Removed YOSYS_NOVERIFIC - temporarily?
# PARALLEL_TEST_DIRS += verific/extensions/tests/passing
##################################
# TESTS THAT DO NOT GENERATE .MK #
##################################
SEED_TEST_DIRS =
SEED_TEST_DIRS += tests/simple
SEED_TEST_DIRS += tests/simple_abc9
SEED_TEST_DIRS += tests/hana
SEED_TEST_DIRS += tests/asicworld
# TODO dig up why is this commented out
# SEED_TEST_DIRS += tests/realmath
SEED_TEST_DIRS += tests/share
SEED_TEST_DIRS += tests/opt_share
SEED_TEST_DIRS += tests/fsm
SEED_TEST_DIRS += tests/memlib
SEED_TEST_DIRS += tests/bram
SEED_TEST_DIRS += tests/svinterfaces
SEED_TEST_DIRS += tests/xprop
SEED_TEST_DIRS += tests/select
SEED_TEST_DIRS += tests/proc
SEED_TEST_DIRS += tests/blif
SEED_TEST_DIRS += tests/arch
SEED_TEST_DIRS += tests/rpc
SEED_TEST_DIRS += tests/memfile
SEED_TEST_DIRS += tests/fmt
SEED_TEST_DIRS += tests/cxxrtl
ifeq ($(ENABLE_FUNCTIONAL_TESTS),1)
SEED_TEST_DIRS += tests/functional
endif endif
test: $(TARGETS) $(EXTRA_TARGETS) ################################
ifeq ($(ENABLE_VERIFIC),1) # TESTS THAT NEED SPECIAL ARGS #
ifeq ($(YOSYS_NOVERIFIC),1) ################################
@echo
@echo "Running tests without verific support due to YOSYS_NOVERIFIC=1" ABC_TEST_DIRS =
@echo ABC_TEST_DIRS += tests/memories
else ABC_TEST_DIRS += tests/aiger
+cd tests/verific && bash run-test.sh $(SEEDOPT)
endif ############
endif # THE GUTS #
+cd tests/simple && bash run-test.sh $(SEEDOPT) ############
+cd tests/simple_abc9 && bash run-test.sh $(SEEDOPT)
+cd tests/hana && bash run-test.sh $(SEEDOPT) # seed-tests/ is a dummy string, not a directory
+cd tests/asicworld && bash run-test.sh $(SEEDOPT) .PHONY: seed-tests
# +cd tests/realmath && bash run-test.sh $(SEEDOPT) seed-tests: $(SEED_TEST_DIRS:%=seed-tests/%)
+cd tests/share && bash run-test.sh $(SEEDOPT) .PHONY: seed-tests/%
+cd tests/opt_share && bash run-test.sh $(SEEDOPT) seed-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
+cd tests/fsm && bash run-test.sh $(SEEDOPT) +cd $* && bash run-test.sh $(SEEDOPT)
+cd tests/techmap && bash run-test.sh +@echo "...passed tests in $*"
+cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
+cd tests/memlib && bash run-test.sh $(SEEDOPT) # abcopt-tests/ is a dummy string, not a directory
+cd tests/bram && bash run-test.sh $(SEEDOPT) .PHONY: abcopt-tests
+cd tests/various && bash run-test.sh abcopt-tests: $(ABC_TEST_DIRS:%=abcopt-tests/%)
+cd tests/select && bash run-test.sh abcopt-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
+cd tests/sat && bash run-test.sh +cd $* && bash run-test.sh $(ABCOPT) $(SEEDOPT)
+cd tests/sim && bash run-test.sh +@echo "...passed tests in $*"
+cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
+cd tests/svtypes && bash run-test.sh $(SEEDOPT) # makefile-tests/ is a dummy string, not a directory
+cd tests/proc && bash run-test.sh .PHONY: makefile-tests
+cd tests/blif && bash run-test.sh makefile-tests: $(PARALLEL_TEST_DIRS:%=makefile-tests/%)
+cd tests/opt && bash run-test.sh # this target actually emits .mk files
+cd tests/aiger && bash run-test.sh $(ABCOPT) %.mk:
+cd tests/arch && bash run-test.sh +cd $(dir $*) && bash run-test.sh
+cd tests/arch/ice40 && bash run-test.sh $(SEEDOPT) # this one spawns submake on each
+cd tests/arch/xilinx && bash run-test.sh $(SEEDOPT) makefile-tests/%: %/run-test.mk $(TARGETS) $(EXTRA_TARGETS)
+cd tests/arch/ecp5 && bash run-test.sh $(SEEDOPT) $(MAKE) -C $* -f run-test.mk
+cd tests/arch/machxo2 && bash run-test.sh $(SEEDOPT) +@echo "...passed tests in $*"
+cd tests/arch/efinix && bash run-test.sh $(SEEDOPT)
+cd tests/arch/anlogic && bash run-test.sh $(SEEDOPT) test: makefile-tests abcopt-tests seed-tests
+cd tests/arch/gowin && bash run-test.sh $(SEEDOPT)
+cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
+cd tests/arch/nanoxplore && bash run-test.sh $(SEEDOPT)
+cd tests/arch/nexus && bash run-test.sh $(SEEDOPT)
+cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT)
+cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT)
+cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT)
+cd tests/arch/microchip && bash run-test.sh $(SEEDOPT)
+cd tests/rpc && bash run-test.sh
+cd tests/memfile && bash run-test.sh
+cd tests/verilog && bash run-test.sh
+cd tests/xprop && bash run-test.sh $(SEEDOPT)
+cd tests/fmt && bash run-test.sh
+cd tests/cxxrtl && bash run-test.sh
ifeq ($(ENABLE_FUNCTIONAL_TESTS),1)
+cd tests/functional && bash run-test.sh
endif
@echo "" @echo ""
@echo " Passed \"make test\"." @echo " Passed \"make test\"."
@echo "" @echo ""

View File

@ -4,7 +4,7 @@ YOSYS_BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../ >/dev/null 2>&1 && pwd)
# $ generate_target target_name test_command # $ generate_target target_name test_command
generate_target() { generate_target() {
target_name=$1 target_name=$(basename $PWD)-$1
test_command=$2 test_command=$2
echo "all: $target_name" echo "all: $target_name"
echo ".PHONY: $target_name" echo ".PHONY: $target_name"
@ -107,5 +107,5 @@ generate_tests() {
run_tests() { run_tests() {
generate_tests "$@" > run-test.mk generate_tests "$@" > run-test.mk
exec ${MAKE:-make} -f run-test.mk # exec ${MAKE:-make} -f run-test.mk
} }