Open JyJyJcr opened 7 months ago
Hi there, once again thank you for all of your contributions. I talked over this PR with some of the other project maintainers and there is a strong opinion that this functionality may be better in another project/library that supplements ngx-rust
. Would it be possible to do that rather than integrate it into the core SDK?
Of course possible (and I agree to split it from the core), but before changing let me clarify which is better, creating a new GitHub repository, or just separating it into a new subdirectory in this repository, just like nginx-sys
?
Sidenote: we need to keep nginx-sys::metadata
module to salvage build informations for integration tests in either case.
Sidenote: we need to keep
nginx-sys::metadata
module to salvage build informations for integration tests in either case.
There's nginx-sys::NGX_PREFIX
that already contains the installation path (NULL-terminated u8 slice, so you need to strip the last byte and use std::os::unix::ffi::OsStrExt
).
It's also optional and could be omitted by the buildsystem if you specify an empty --prefix (we do that for the official Windows builds), but that's only a problem with non-vendored Nginx source tree.
There's
nginx-sys::NGX_PREFIX
that already contains the installation path (NULL-terminated u8 slice, so you need to strip the last byte and usestd::os::unix::ffi::OsStrExt
).
Thank you for important information. Now test_util
directly uses constants in bindings.rs
(not only NGX_PREFIX
but also other configurations, such as NGX_CONF_PATH
).
Proposed changes
This PR adds
test_util
module, utilities for integration tests of Nginx modules. The utilities were moved fromtests/log_test.rs
, and fixed to use the bundled Nginx used in bindings, the install path of which is recorded innginx-sys::metadata::NGINX_INSTALL_DIR
.Checklist
Before creating a PR, run through this checklist and mark each as complete.