Skip to content

Question: how to handle custom environment variables and captured output? #13

@volks73

Description

@volks73

I am experimenting with your crate for testing my cargo-wix subcommand. This would be for Windows and it most revolves around modifying the Current Working Directory (CWD) for each of the tests. I have been testing with --test-threads=1, which forces all tests to execute serially. I added any integration tests that modify the CWD to the rusty_fork_test! macro, and it all appeared to work great! I can now run the tests without forcing serial execution. Thank you!

However, I have implemented a series of CARGO_WIX_TEST_<NAME> environment variables to toggle various outputs and functionality when running tests. These no longer appear to be working with the tests. Please see the Tests section of the README for information about the various environment variables.

I cannot tell if these environment variables are being passed to each of the tests or if it is something related to capturing output/redirecting STDOUT and STDERR with the "forked" child processes. I tried answering this myself by looking through the macro implementation, but I quickly became lost. I am hoping you could provide some direction and/or information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions