3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-27 04:16:28 +00:00

Integrate tests

This commit is contained in:
Miodrag Milanovic 2026-05-26 15:39:15 +02:00
parent ed263d26cc
commit 25b6a1f651
3 changed files with 26 additions and 6 deletions

View file

@ -480,6 +480,21 @@ yosys_config_script(INSTALL)
# Tests.
add_subdirectory(tests/unit)
# TODO(cmake): other tests
add_custom_target(vanilla-test
COMMAND make -C ${CMAKE_SOURCE_DIR}/tests vanilla-test
BUILD_DIR=${CMAKE_BINARY_DIR}
PROGRAM_PREFIX=${YOSYS_PROGRAM_PREFIX}
DEPENDS yosys
)
add_custom_target(unit-test
COMMAND ${CMAKE_CTEST_COMMAND} --test-dir ${CMAKE_BINARY_DIR}/tests/unit --output-on-failure
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(test
DEPENDS vanilla-test unit-test
)
# Docs.
add_custom_target(docs-prepare

View file

@ -1,6 +1,11 @@
OVERRIDE_MAIN=1
include ./common.mk
SEED ?=
ifneq ($(strip $(SEED)),)
SEEDOPT_GEN := -S$(SEED)
endif
# Directories with tests not run:
# errors
# lut
@ -87,7 +92,7 @@ prep: $(MK_TEST_DIRS:%=%/Makefile)
.PHONY: force-create
# this target actually emits Makefile files
%/Makefile: force-create
+@cd $* && python3 generate_mk.py
+@cd $* && python3 generate_mk.py $(SEEDOPT_GEN)
makefile-./%: %/Makefile
@$(MAKE) -C $*

View file

@ -3,11 +3,11 @@ BUILD_DIR ?= $(realpath $(ROOT_DIR)/../build)
SRC_DIR := $(realpath $(ROOT_DIR)/..)
SBY ?= sby
YOSYS ?= $(BUILD_DIR)/yosys
ABC ?= $(BUILD_DIR)/yosys-abc
YOSYS_FILTERLIB ?= $(BUILD_DIR)/yosys-filterlib
YOSYS_CONFIG ?= $(BUILD_DIR)/yosys-config
YOSYS_SMTBMC ?= $(BUILD_DIR)/yosys-smtbmc
YOSYS ?= $(BUILD_DIR)/$(PROGRAM_PREFIX)yosys
ABC ?= $(BUILD_DIR)/$(PROGRAM_PREFIX)yosys-abc
YOSYS_FILTERLIB ?= $(BUILD_DIR)/$(PROGRAM_PREFIX)yosys-filterlib
YOSYS_CONFIG ?= $(BUILD_DIR)/$(PROGRAM_PREFIX)yosys-config
YOSYS_SMTBMC ?= $(BUILD_DIR)/$(PROGRAM_PREFIX)yosys-smtbmc
YOSYS_MAX_THREADS ?= 4
COVERAGE_DIR ?= $(realpath $(ROOT_DIR)/..)/coverage
COVERAGE_HTML ?= $(realpath $(ROOT_DIR)/..)/coverage_html