From 96141b431e3f992624fdf4f4c73d8ecd3d509f11 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 9 Jan 2014 16:39:39 +0000 Subject: [PATCH] Implement "make check" for zenmap Currently, this just uses Python's unittest module to autodiscover tests, which may skip some, but is better than nothing. TODO: move tests to their own module and let the zenmap_check target test them directly. --- Makefile.in | 5 ++++- configure | 4 ++++ configure.ac | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 8eab72a3cb..b4dd034561 100644 --- a/Makefile.in +++ b/Makefile.in @@ -394,7 +394,10 @@ ncat_check: nsock_check: @cd $(NSOCKDIR)/src && $(MAKE) check -check: @NCAT_CHECK@ @NSOCK_CHECK@ +zenmap_check: + @cd $(ZENMAPDIR) && $(PYTHON) -m unittest discover build/lib.* '*.py' + +check: @NCAT_CHECK@ @NSOCK_CHECK@ @ZENMAP_CHECK@ ${srcdir}/configure: configure.ac cd ${srcdir} && autoconf diff --git a/configure b/configure index 565a400003..799a3cc55b 100755 --- a/configure +++ b/configure @@ -681,6 +681,7 @@ NPINGDIR subdirs ZENMAP_DIST_CLEAN ZENMAP_CLEAN +ZENMAP_CHECK UNINSTALLZENMAP INSTALLZENMAP BUILDZENMAP @@ -5953,12 +5954,14 @@ if test "$with_zenmap" = "no"; then BUILDZENMAP="" INSTALLZENMAP="" UNINSTALLZENMAP="" + ZENMAP_CHECK="" ZENMAP_CLEAN="" ZENMAP_DIST_CLEAN="" else BUILDZENMAP=build-zenmap INSTALLZENMAP=install-zenmap UNINSTALLZENMAP=uninstall-zenmap + ZENMAP_CHECK=zenmap_check ZENMAP_CLEAN=zenmap_clean ZENMAP_DIST_CLEAN=zenmap_dist_clean fi @@ -5969,6 +5972,7 @@ fi + NPINGDIR=nping # Do they want Nping? diff --git a/configure.ac b/configure.ac index 79943ad0db..d3bfb6ae0d 100644 --- a/configure.ac +++ b/configure.ac @@ -250,12 +250,14 @@ if test "$with_zenmap" = "no"; then BUILDZENMAP="" INSTALLZENMAP="" UNINSTALLZENMAP="" + ZENMAP_CHECK="" ZENMAP_CLEAN="" ZENMAP_DIST_CLEAN="" else BUILDZENMAP=build-zenmap INSTALLZENMAP=install-zenmap UNINSTALLZENMAP=uninstall-zenmap + ZENMAP_CHECK=zenmap_check ZENMAP_CLEAN=zenmap_clean ZENMAP_DIST_CLEAN=zenmap_dist_clean fi @@ -263,6 +265,7 @@ AC_SUBST(ZENMAPDIR) AC_SUBST(BUILDZENMAP) AC_SUBST(INSTALLZENMAP) AC_SUBST(UNINSTALLZENMAP) +AC_SUBST(ZENMAP_CHECK) AC_SUBST(ZENMAP_CLEAN) AC_SUBST(ZENMAP_DIST_CLEAN)