Skip to content

add --enable-test-apps to build test binaries at make time - #784

Open
PaulLodge wants to merge 2 commits into
apache:trunkfrom
PaulLodge:test-apps-at-buildtime
Open

PaulLodge wants to merge 2 commits into
apache:trunkfrom
PaulLodge:test-apps-at-buildtime

Conversation

@PaulLodge

Copy link
Copy Markdown

The pyhttpd test framework relies on four native binaries: three Apache modules (mod_aptest, mod_h1test, mod_h2test) and a standalone HTTP/2 WebSocket client (h2ws). Currently, the three modules are compiled on-the-fly via apxs -c each time the test framework starts, and h2ws is built by invoking make in test/clients/ during test setup.

This change introduces --enable-test-apps, a configure-time flag that moves all four builds into the normal make phase. When the flag is set, configure verifies that the required dependencies are present — nghttp2 for the h2ws client and DSO support for the shared test modules — and fails with a clear error message if either is missing. The three modules are
compiled as shared objects in test/test-modules/ using the same libtool SH_LINK pattern used by all standard Apache modules, while h2ws is built by delegating to its existing Makefile in test/clients/.

The pre-built module location is communicated to the Python test framework through config.ini's pre_built_test_binaries_dir setting — the same mechanism already used by Windows and CMake builds. When this path is set, the _add_aptest(), _add_h1test(), and _add_h2test() methods skip their apxs -c calls and load modules directly from the pre-built directory. The existing _build_clients() method already checks this setting and skips its runtime build accordingly.

When --enable-test-apps is not specified, the configure and build behavior is identical to before: the flag defaults to no, TEST_MODULES_DIR resolves to an empty string (which is falsy in Python), and all test binaries continue to be compiled at test runtime as they always have been.

Co-authored-by: Claude Opus 4.6 noreply@anthropic.com

@PaulLodge

Copy link
Copy Markdown
Author

Tested locally on Linux fc43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant