diff --git a/.github/test.sh b/.github/test.sh deleted file mode 100755 index 362020f3d..000000000 --- a/.github/test.sh +++ /dev/null @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5197876b9..3dfaa7f89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/Makefile.in b/Makefile.in index f94707363..86ede6b2e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/configure.ac b/configure.ac index 363010118..b260ceb5d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ivtest/Makefile.in b/ivtest/Makefile.in new file mode 100644 index 000000000..ba7667d07 --- /dev/null +++ b/ivtest/Makefile.in @@ -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