Skip to content

Commit 603e5eb

Browse files
committed
test: every test everywhere all at once
1 parent e91e95f commit 603e5eb

File tree

2 files changed

+98
-63
lines changed

2 files changed

+98
-63
lines changed

Makefile

Lines changed: 96 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -842,69 +842,104 @@ else
842842
ABCOPT=""
843843
endif
844844

845-
# When YOSYS_NOVERIFIC is set as a make variable, also export it to the
846-
# enviornment, so that `YOSYS_NOVERIFIC=1 make test` _and_
847-
# `make test YOSYS_NOVERIFIC=1` will run with verific disabled.
848-
ifeq ($(YOSYS_NOVERIFIC),1)
849-
export YOSYS_NOVERIFIC
850-
endif
851845

852-
test: $(TARGETS) $(EXTRA_TARGETS)
853-
ifeq ($(ENABLE_VERIFIC),1)
854-
ifeq ($(YOSYS_NOVERIFIC),1)
855-
@echo
856-
@echo "Running tests without verific support due to YOSYS_NOVERIFIC=1"
857-
@echo
858-
else
859-
+cd tests/verific && bash run-test.sh $(SEEDOPT)
860-
endif
861-
endif
862-
+cd tests/simple && bash run-test.sh $(SEEDOPT)
863-
+cd tests/simple_abc9 && bash run-test.sh $(SEEDOPT)
864-
+cd tests/hana && bash run-test.sh $(SEEDOPT)
865-
+cd tests/asicworld && bash run-test.sh $(SEEDOPT)
866-
# +cd tests/realmath && bash run-test.sh $(SEEDOPT)
867-
+cd tests/share && bash run-test.sh $(SEEDOPT)
868-
+cd tests/opt_share && bash run-test.sh $(SEEDOPT)
869-
+cd tests/fsm && bash run-test.sh $(SEEDOPT)
870-
+cd tests/techmap && bash run-test.sh
871-
+cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
872-
+cd tests/memlib && bash run-test.sh $(SEEDOPT)
873-
+cd tests/bram && bash run-test.sh $(SEEDOPT)
874-
+cd tests/various && bash run-test.sh
875-
+cd tests/select && bash run-test.sh
876-
+cd tests/sat && bash run-test.sh
877-
+cd tests/sim && bash run-test.sh
878-
+cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
879-
+cd tests/svtypes && bash run-test.sh $(SEEDOPT)
880-
+cd tests/proc && bash run-test.sh
881-
+cd tests/blif && bash run-test.sh
882-
+cd tests/opt && bash run-test.sh
883-
+cd tests/aiger && bash run-test.sh $(ABCOPT)
884-
+cd tests/arch && bash run-test.sh
885-
+cd tests/arch/ice40 && bash run-test.sh $(SEEDOPT)
886-
+cd tests/arch/xilinx && bash run-test.sh $(SEEDOPT)
887-
+cd tests/arch/ecp5 && bash run-test.sh $(SEEDOPT)
888-
+cd tests/arch/machxo2 && bash run-test.sh $(SEEDOPT)
889-
+cd tests/arch/efinix && bash run-test.sh $(SEEDOPT)
890-
+cd tests/arch/anlogic && bash run-test.sh $(SEEDOPT)
891-
+cd tests/arch/gowin && bash run-test.sh $(SEEDOPT)
892-
+cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
893-
+cd tests/arch/nanoxplore && bash run-test.sh $(SEEDOPT)
894-
+cd tests/arch/nexus && bash run-test.sh $(SEEDOPT)
895-
+cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT)
896-
+cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT)
897-
+cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT)
898-
+cd tests/arch/microchip && bash run-test.sh $(SEEDOPT)
899-
+cd tests/rpc && bash run-test.sh
900-
+cd tests/memfile && bash run-test.sh
901-
+cd tests/verilog && bash run-test.sh
902-
+cd tests/xprop && bash run-test.sh $(SEEDOPT)
903-
+cd tests/fmt && bash run-test.sh
904-
+cd tests/cxxrtl && bash run-test.sh
846+
###########################
847+
# TESTS THAT GENERATE .MK #
848+
###########################
849+
PARALLEL_TEST_DIRS =
850+
PARALLEL_TEST_DIRS += tests/arch/anlogic
851+
PARALLEL_TEST_DIRS += tests/arch/ecp5
852+
PARALLEL_TEST_DIRS += tests/arch/efinix
853+
PARALLEL_TEST_DIRS += tests/arch/gatemate
854+
PARALLEL_TEST_DIRS += tests/arch/gowin
855+
PARALLEL_TEST_DIRS += tests/arch/ice40
856+
PARALLEL_TEST_DIRS += tests/arch/intel_alm
857+
PARALLEL_TEST_DIRS += tests/arch/machxo2
858+
PARALLEL_TEST_DIRS += tests/arch/microchip
859+
PARALLEL_TEST_DIRS += tests/arch/nanoxplore
860+
PARALLEL_TEST_DIRS += tests/arch/nexus
861+
PARALLEL_TEST_DIRS += tests/arch/quicklogic/pp3
862+
PARALLEL_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f
863+
PARALLEL_TEST_DIRS += tests/arch/xilinx
864+
PARALLEL_TEST_DIRS += tests/opt
865+
PARALLEL_TEST_DIRS += tests/sat
866+
PARALLEL_TEST_DIRS += tests/sim
867+
PARALLEL_TEST_DIRS += tests/svtypes
868+
PARALLEL_TEST_DIRS += tests/techmap
869+
PARALLEL_TEST_DIRS += tests/various
870+
PARALLEL_TEST_DIRS += tests/verific
871+
PARALLEL_TEST_DIRS += tests/verilog
872+
# FIXME: Removed YOSYS_NOVERIFIC - temporarily?
873+
# PARALLEL_TEST_DIRS += verific/extensions/tests/passing
874+
875+
##################################
876+
# TESTS THAT DO NOT GENERATE .MK #
877+
##################################
878+
SEED_TEST_DIRS =
879+
SEED_TEST_DIRS += tests/simple
880+
SEED_TEST_DIRS += tests/simple_abc9
881+
SEED_TEST_DIRS += tests/hana
882+
SEED_TEST_DIRS += tests/asicworld
883+
# TODO dig up why is this commented out
884+
# SEED_TEST_DIRS += tests/realmath
885+
SEED_TEST_DIRS += tests/share
886+
SEED_TEST_DIRS += tests/opt_share
887+
SEED_TEST_DIRS += tests/fsm
888+
SEED_TEST_DIRS += tests/memlib
889+
SEED_TEST_DIRS += tests/bram
890+
SEED_TEST_DIRS += tests/svinterfaces
891+
SEED_TEST_DIRS += tests/xprop
892+
SEED_TEST_DIRS += tests/select
893+
SEED_TEST_DIRS += tests/proc
894+
SEED_TEST_DIRS += tests/blif
895+
SEED_TEST_DIRS += tests/arch
896+
SEED_TEST_DIRS += tests/rpc
897+
SEED_TEST_DIRS += tests/memfile
898+
SEED_TEST_DIRS += tests/fmt
899+
SEED_TEST_DIRS += tests/cxxrtl
905900
ifeq ($(ENABLE_FUNCTIONAL_TESTS),1)
906-
+cd tests/functional && bash run-test.sh
907-
endif
901+
SEED_TEST_DIRS += tests/functional
902+
endif
903+
904+
################################
905+
# TESTS THAT NEED SPECIAL ARGS #
906+
################################
907+
908+
ABC_TEST_DIRS =
909+
ABC_TEST_DIRS += tests/memories
910+
ABC_TEST_DIRS += tests/aiger
911+
912+
############
913+
# THE GUTS #
914+
############
915+
916+
# seed-tests/ is a dummy string, not a directory
917+
.PHONY: seed-tests
918+
seed-tests: $(SEED_TEST_DIRS:%=seed-tests/%)
919+
.PHONY: seed-tests/%
920+
seed-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
921+
+cd $* && bash run-test.sh $(SEEDOPT)
922+
+@echo "...passed tests in $*"
923+
924+
# abcopt-tests/ is a dummy string, not a directory
925+
.PHONY: abcopt-tests
926+
abcopt-tests: $(ABC_TEST_DIRS:%=abcopt-tests/%)
927+
abcopt-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
928+
+cd $* && bash run-test.sh $(ABCOPT) $(SEEDOPT)
929+
+@echo "...passed tests in $*"
930+
931+
# makefile-tests/ is a dummy string, not a directory
932+
.PHONY: makefile-tests
933+
makefile-tests: $(PARALLEL_TEST_DIRS:%=makefile-tests/%)
934+
# this target actually emits .mk files
935+
%.mk:
936+
+cd $(dir $*) && bash run-test.sh
937+
# this one spawns submake on each
938+
makefile-tests/%: %/run-test.mk $(TARGETS) $(EXTRA_TARGETS)
939+
$(MAKE) -C $* -f run-test.mk
940+
+@echo "...passed tests in $*"
941+
942+
test: makefile-tests abcopt-tests seed-tests
908943
@echo ""
909944
@echo " Passed \"make test\"."
910945
@echo ""

tests/gen-tests-makefile.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ YOSYS_BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../ >/dev/null 2>&1 && pwd)
44

55
# $ generate_target target_name test_command
66
generate_target() {
7-
target_name=$1
7+
target_name=$(basename $PWD)-$1
88
test_command=$2
99
echo "all: $target_name"
1010
echo ".PHONY: $target_name"
@@ -107,5 +107,5 @@ generate_tests() {
107107

108108
run_tests() {
109109
generate_tests "$@" > run-test.mk
110-
exec ${MAKE:-make} -f run-test.mk
110+
# exec ${MAKE:-make} -f run-test.mk
111111
}

0 commit comments

Comments
 (0)