3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-12-16 01:49:01 +00:00

Refactor tests

Organize tests into subdirectories and use a new makefile that scans
.sby files and allows selecting tests by mode, engine, solver and/or
subdirectory. Automatically skips tests that use engines/solvers that
are not found in the PATH.

See `cd tests; make help` for a description of supported make targets.
This commit is contained in:
Jannis Harder 2022-04-11 17:39:05 +02:00
parent 6daa434d85
commit 8da6f07cb3
60 changed files with 328 additions and 101 deletions

View file

@ -1,25 +1,19 @@
SBY_FILES=$(wildcard *.sby)
SBY_TESTS=$(addprefix test_,$(SBY_FILES:.sby=))
CHECK_PY_FILES=$(wildcard *.check.py)
CHECK_PY_TASKS=$(addprefix check_,$(CHECK_PY_FILES:.check.py=))
JUNIT_TESTS=junit_assert_pass junit_assert_fail junit_assert_preunsat \
junit_cover_pass junit_cover_uncovered junit_cover_assert junit_cover_preunsat \
junit_timeout_error_timeout junit_timeout_error_syntax junit_timeout_error_solver
test:
.PHONY: test validate_junit scripted
.PHONY: test clean refresh help
test: $(JUNIT_TESTS) $(CHECK_PY_TASKS)
help:
@cat make/help.txt
test_%: %.sby FORCE
python3 ../sbysrc/sby.py -f $<
export SBY_WORKDIR_GITIGNORE=1
export SBY_MAIN=$(realpath $(dir $(firstword $(MAKEFILE_LIST)))/../sbysrc/sby.py)
$(CHECK_PY_TASKS): check_%: %.check.py test_%
python3 $<
make/rules/collect.mk: make/collect_tests.py
python3 make/collect_tests.py
$(JUNIT_TESTS): $(SBY_TESTS)
python3 validate_junit.py $@/$@.xml
make/rules/test/%.mk:
python3 make/test_rules.py $<
scripted:
make -C scripted
FORCE:
ifneq (help,$(MAKECMDGOALS))
include make/rules/collect.mk
endif