Open
Conversation
ecb0d92 to
05a67cb
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for linking unit tests with nginx library by introducing a new "unittest" feature flag and building a static nginx library. The changes enable unit tests to use C functions from nginx by creating a special static library (libnginx) and adding necessary linker flags when the unittest feature is enabled.
- Introduces a new "unittest" feature flag for nginx-sys and nginx-src crates
- Creates a libnginx module with helper functions for nginx initialization in tests
- Adds build configuration to generate static nginx library and parse linker flags
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/pool.rs | Adds comprehensive unit tests for Pool functionality using nginx C functions |
| nginx-sys/build/main.rs | Extends makefile parsing to extract library flags and adds unittest feature support |
| nginx-sys/Cargo.toml | Defines unittest feature dependency on vendored nginx-src |
| nginx-src/src/lib.rs | Configures nginx build to include libnginx module when unittest feature is enabled |
| nginx-src/libnginx/ | New module providing C wrapper functions for nginx initialization in tests |
| Cargo.toml | Adds nginx-sys with unittest feature as dev dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
05a67cb to
90fe91f
Compare
bavshin-f5
reviewed
Nov 17, 2025
fe1ca87 to
0c9d697
Compare
e3330ff to
00cbf09
Compare
Some unit tests may use C functions from nginx. To support this scenario, special static library is built. Necessary linker flags are also added. Since these changes are needed for specific unit tests only, new feature "unittest" is defined.
00cbf09 to
a1510a8
Compare
Abhi7739309
reviewed
Nov 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Some unit tests may use C functions from nginx. To support this scenario, special static library is built. Necessary linker flags are also added. Since these changes are needed for specific unit tests only, new feature "unittest" is defined in
nginx-sysandnginx-srccrates.Checklist
Before creating a PR, run through this checklist and mark each as complete.