]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Compile system test binaries during make
authorTom Krizek <tkrizek@isc.org>
Mon, 7 Aug 2023 14:59:11 +0000 (16:59 +0200)
committerTom Krizek <tkrizek@isc.org>
Mon, 21 Aug 2023 18:04:48 +0000 (20:04 +0200)
Using check_PROGRAMS would postpone compiling the binaries needed by
system tests until `make check` would be called. Since it's preferable
to invoke pytest directly to run the system test suite, compile these
binaries without installing them during `make all` instead by using
noinst_PROGRAMS.

This removes the need to use TESTS= make -e check hack invoked from
pytest to work around this issue.

bin/tests/system/Makefile.am
bin/tests/system/conftest.py
bin/tests/system/dlzexternal/driver/Makefile.am
bin/tests/system/dyndb/driver/Makefile.am
bin/tests/system/hooks/driver/Makefile.am
bin/tests/system/rpz/testlib/Makefile.am

index ab716ac0c796356edd58ae369a79cfd24b168262..44282372de6b39f7fdda9333c62520c9f536cace 100644 (file)
@@ -25,7 +25,7 @@ LDADD +=                      \
 
 if HAVE_PERL
 
-check_PROGRAMS =               \
+noinst_PROGRAMS =              \
        feature-test            \
        makejournal             \
        pipelined/pipequeries   \
index fcdc379c47c86bf530de6c42c9e4b27066d12562..0be546b8106461a789d8f11f5d3e37144155c9e3 100644 (file)
@@ -189,28 +189,6 @@ else:
         # Ensure this hook only runs on the main pytest instance if xdist is
         # used to spawn other workers.
         if not XDIST_WORKER:
-            CONFTEST_LOGGER.debug("compiling required files")
-            env = os.environ.copy()
-            env["TESTS"] = ""  # disable automake test framework - compile-only
-            try:
-                # FUTURE: Remove the need to run this compilation command
-                # before executing tests. Currently it's only here to have
-                # on-par functionality with the legacy test framework.
-                proc = subprocess.run(
-                    "make -e check",
-                    shell=True,
-                    check=True,
-                    cwd=FILE_DIR,
-                    stdout=subprocess.PIPE,
-                    stderr=subprocess.STDOUT,
-                    env=env,
-                )
-            except subprocess.CalledProcessError as exc:
-                CONFTEST_LOGGER.debug(exc.stdout)
-                CONFTEST_LOGGER.error("failed to compile test files: %s", exc)
-                raise exc
-            CONFTEST_LOGGER.debug(proc.stdout)
-
             if config.pluginmanager.has_plugin("xdist") and config.option.numprocesses:
                 # system tests depend on module scope for setup & teardown
                 # enforce use "loadscope" scheduler or disable paralelism
index a8211d1fb1dc963ee67042ef9bd5bbb8104f0a02..0028edb573ecc700175157c6440be1bedf6296d4 100644 (file)
@@ -4,7 +4,7 @@ AM_CPPFLAGS +=                  \
        $(LIBISC_CFLAGS)        \
        $(LIBDNS_CFLAGS)
 
-check_LTLIBRARIES = dlzexternal.la
+noinst_LTLIBRARIES = dlzexternal.la
 
 dlzexternal_la_SOURCES =       \
        driver.c                \
index e41a30a860b039bef8b3d2f8cd81e96e62937311..3e6b4a4890650b4376a442df7aa6b3fc700657f0 100644 (file)
@@ -4,7 +4,7 @@ AM_CPPFLAGS +=                  \
        $(LIBISC_CFLAGS)        \
        $(LIBDNS_CFLAGS)
 
-check_LTLIBRARIES = sample.la
+noinst_LTLIBRARIES = sample.la
 
 sample_la_SOURCES =    \
        db.c            \
index ffa074a27ce5ee95e46de5262098ff59fde95675..b0c4b799c47d40f172950c508082a147f5c6b684 100644 (file)
@@ -6,7 +6,7 @@ AM_CPPFLAGS +=                  \
        $(LIBNS_CFLAGS)         \
        $(LIBISCCFG_CFLAGS)
 
-check_LTLIBRARIES = test-async.la
+noinst_LTLIBRARIES = test-async.la
 
 test_async_la_SOURCES = test-async.c
 test_async_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir)
index 6e32f9cf9835d16ca38244ac3c2486be6f372bd7..6271fdb3fab9a4ae6006cef619c8a54bdc040dd9 100644 (file)
@@ -6,7 +6,7 @@ AM_CPPFLAGS +=                  \
 
 AM_CFLAGS += -Wall -pedantic
 
-check_LTLIBRARIES = libdummyrpz.la
+noinst_LTLIBRARIES = libdummyrpz.la
 libdummyrpz_la_SOURCES= dummylib.c test-data.c trpz.h test-data.h
 libdummyrpz_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir)
 LDADD += -lpthread $(DLOPEN_LIBS)