ivtest: add check targets running with build dir

To simplify things for the user, additional targets `check-full`,
`check-vpi`, `check-vvp`, and `check-vvp-py` have been added,
which automatically execute the steps listed above in the background.

Once the installation dependency has been resolved, these targets
allow the tests to be run directly from the build directory without
delay.
This commit is contained in:
Ralf Habacker 2026-04-28 22:00:26 +02:00
parent 0ade4a86a1
commit 31a599722f
5 changed files with 54 additions and 4 deletions

View File

@ -166,7 +166,7 @@ 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:
check-full check-vpi check-vvp check-vvp-py check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py:
$(MAKE) -C ivtest $@
clean:
@ -411,4 +411,4 @@ uninstall:
-include $(patsubst %.o, dep/%.d, $O)
.PHONY: check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py
.PHONY: check-full check-vpi check-vvp check-vvp-py check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py

1
aclocal.m4 vendored
View File

@ -17,6 +17,7 @@ m4_include([m4/ax_c99_strtod.m4])
m4_include([m4/ax_c_picflag.m4])
m4_include([m4/ax_c_underscores_leading.m4])
m4_include([m4/ax_c_underscores_trailing.m4])
m4_include([m4/ax_configure_args_no_prefix.m4])
m4_include([m4/ax_cxx_compile_stdcxx.m4])
m4_include([m4/ax_enable_suffix.m4])
m4_include([m4/ax_ld_extralibs.m4])

View File

@ -36,6 +36,9 @@ AC_CONFIG_HEADERS([tgt-vvp/vvp_config.h])
AC_CONFIG_HEADERS([tgt-vhdl/vhdl_config.h])
AC_CONFIG_HEADERS([tgt-pcb/pcb_config.h])
dnl used by ivtest
AX_CONFIGURE_ARGS_NO_PREFIX
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC

View File

@ -17,6 +17,8 @@
#
SHELL = /bin/sh
abs_builddir=@abs_builddir@
abs_top_srcdir=@abs_top_srcdir@
abs_srcdir=@abs_srcdir@
srcdir=@srcdir@
suffix = @install_suffix@
@ -26,15 +28,34 @@ else
opts = --suffix=$(suffix)
endif
AX_CONFIGURE_ARGS_NO_PREFIX=@AX_CONFIGURE_ARGS_NO_PREFIX@
all:
check:
build/Makefile:
mkdir -p build
cd build && $(abs_top_srcdir)/configure $(AX_CONFIGURE_ARGS_NO_PREFIX) --prefix=$(abs_builddir)/install
$(MAKE) -C build install
check-full: build/Makefile
make -C build/ivtest check-installed
check-vpi: build/Makefile
make -C build/ivtest check-installed-vpi
check-vvp: build/Makefile
make -C build/ivtest check-installed-vvp
check-vvp-py: build/Makefile
make -C build/ivtest check-installed-vvp-py
check-installed:
@status=0; \
$(MAKE) check-installed-vpi || status=1; \
$(MAKE) check-installed-vvp || status=1; \
$(MAKE) check-installed-vvp-py || status=1; \
$(MAKE) check-installed-vpi || status=1; \
exit $$status
check-installed-vpi:
@ -56,6 +77,7 @@ check-installed-vvp-py:
clean:
rm -f $(srcdir)/*.vpi
rm -rf $(srcdir)/log $(srcdir)/vpi_log $(srcdir)/work
rm -rf build install
distclean: clean
rm -f Makefile
@ -67,4 +89,4 @@ 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
.PHONY: check-full check-vpi check-vvp check-vvp-py check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py

View File

@ -0,0 +1,24 @@
AC_DEFUN([AX_CONFIGURE_ARGS_NO_PREFIX],[
ax_configure_args_no_prefix=
ax_skip_next=no
for ac_arg in $(echo "$ac_configure_args" | sed "s,',,g"); do
if test "x$ax_skip_next" = "xyes"; then
ax_skip_next=no
continue
fi
case $ac_arg in
--prefix)
ax_skip_next=yes
;;
--prefix=*)
;;
*)
ax_configure_args_no_prefix="$ax_configure_args_no_prefix '$ac_arg'"
;;
esac
done
AC_SUBST([AX_CONFIGURE_ARGS_NO_PREFIX], [$ax_configure_args_no_prefix])
])