ivtest: Integration of regression tests into the build system

Replace .github/test.sh with a unified set of targets installed
via `make check-*` in ivtest/, thereby removing CI-specific test
coordination. This avoids duplication in the regression logic and
ensures consistent execution between local and CI environments.
PLI1-dependent tests are now correctly controlled via
`configure --enable-libveriuser`.

Currently, the regression suite still depends on an iverilog package,
which must be installed manually at the location specified with
`configure --prefix=*`. Afterward, the complete regression suite
(VVP, VPI, and Python tests) can be run via `make check-installed`
and individual checks can be run with `check-installed-vpi`,
`check-installed-vvp` and `check-installed-vvp-py`.
This commit is contained in:
Ralf Habacker 2026-04-27 13:57:03 +02:00
parent 03cac78504
commit c14c73dd9a
5 changed files with 83 additions and 28 deletions

20
.github/test.sh vendored
View File

@ -1,20 +0,0 @@
#!/usr/bin/env sh
echo "Using the bundled ivtest to run regression tests."
echo " pwd = $(pwd)"
cd ivtest
status=0
perl vvp_reg.pl || status=1
if [ "x$1" = "xno-pli1" ] ; then
perl vpi_reg.pl || status=1
else
perl vpi_reg.pl --with-pli1 || status=1
fi
python3 vvp_reg.py || status=1
exit $status

View File

@ -34,7 +34,8 @@ jobs:
sudo make install
- name: Test
run: ./.github/test.sh
run: |
make check-installed
lin:
@ -64,7 +65,8 @@ jobs:
sudo make install
- name: Test
run: ./.github/test.sh
run:
make check-installed
- name: Documentation
run: |
@ -120,11 +122,7 @@ jobs:
- name: Test
run: |
if [ ${{ matrix.msystem }} = "CLANG64" ] ; then
./.github/test.sh no-pli1
else
./.github/test.sh
fi
make check-installed
- uses: actions/upload-artifact@v4
with:

View File

@ -40,7 +40,8 @@ VERSION_MAJOR = @VERSION_MAJOR@
VERSION_MINOR = @VERSION_MINOR@
SUBDIRS = ivlpp vhdlpp vvp vpi tgt-null tgt-stub tgt-vvp \
tgt-vhdl tgt-vlog95 tgt-pcb tgt-blif tgt-sizer driver
tgt-vhdl tgt-vlog95 tgt-pcb tgt-blif tgt-sizer driver \
ivtest
# Only run distclean for these directories.
NOTUSED = tgt-fpga tgt-pal tgt-verilog
@ -165,6 +166,9 @@ else
$(ENV_VVP) vvp/vvp -M- -M./vpi ./check.vvp | grep 'Hello, World'
endif
check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py:
$(MAKE) -C ivtest $@
clean:
$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@ && ) true
rm -f *.o parse.cc parse.h lexor.cc
@ -407,3 +411,5 @@ uninstall:
-include $(patsubst %.o, dep/%.d, $O)
.PHONY: check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py

View File

@ -412,6 +412,7 @@ AC_CONFIG_FILES([
driver/iverilog.man
iverilog-vpi.man
ivlpp/Makefile
ivtest/Makefile
libveriuser/Makefile
tgt-blif/Makefile
tgt-fpga/Makefile

70
ivtest/Makefile.in Normal file
View File

@ -0,0 +1,70 @@
#
# This source code is free software; you can redistribute it
# and/or modify it in source code form under the terms of the GNU
# Library General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
SHELL = /bin/sh
abs_srcdir=@abs_srcdir@
srcdir=@srcdir@
suffix = @install_suffix@
ifeq (@install_suffix@,)
opts =
else
opts = --suffix=$(suffix)
endif
all:
check:
check-installed:
@status=0; \
$(MAKE) check-installed-vpi || status=1; \
$(MAKE) check-installed-vvp || status=1; \
$(MAKE) check-installed-vvp-py || status=1; \
exit $$status
check-installed-vpi:
@echo "Running vpi_reg.pl"
ifeq (@LIBVERIUSER@,yes)
cd $(abs_srcdir); perl vpi_reg.pl --with-pli1 $(opts)
else
cd $(abs_srcdir); perl vpi_reg.pl $(opts)
endif
check-installed-vvp:
@echo "Running vvp_reg.pl"
cd $(abs_srcdir); perl vvp_reg.pl $(opts)
check-installed-vvp-py:
@echo "Running vvp_reg.py"
cd $(abs_srcdir); python3 vvp_reg.py $(opts)
clean:
rm -f $(srcdir)/*.vpi
rm -rf $(srcdir)/log $(srcdir)/vpi_log $(srcdir)/work
distclean: clean
rm -f Makefile
install:
uninstall:
Makefile: $(srcdir)/Makefile.in ../config.status
cd ..; ./config.status --file=ivtest/$@
.PHONY: check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py