-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nextest-runner] use a setup script to seed build for integration tes…
…ts (#1963) Currently, all our integration tests build a separate copy of the nextest fixtures. This is a lot of unnecessary extra build work. We now have a great solution, though -- use setup scripts! This kind of build caching is exactly what setup scripts are good at, and this also gives us a chance to dogfood them in the nextest repo proper (rather than just in the fixtures). This is a really nice performance improvement on my local machine (goes from ~5s to ~3s) -- should see a similar or even better result in CI. To make the tests still work, I had to do two internal/unstable things: 1. Add a `debug current-exe` command to get the current executable. Not part of the stable interface, though not hugely painful to stabilize it if there's a compelling use case. 2. Add `__NEXTEST_ALT_TARGET_DIR` to ensure that we're still testing the situation where linked paths aren't found. This is definitely a test-only knob that shouldn't be stabilized.
- Loading branch information
1 parent
2635cb6
commit 337840e
Showing
19 changed files
with
718 additions
and
252 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,4 @@ extern "C" { | |
#[test] | ||
fn test_multiply_two() { | ||
assert_eq!(unsafe { multiply_two(3, 3) }, 9); | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) The nextest Contributors | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
||
#[track_caller] | ||
pub fn set_env_vars() { | ||
// The dynamic library tests require this flag. | ||
std::env::set_var("RUSTFLAGS", "-C prefer-dynamic"); | ||
// Set CARGO_TERM_COLOR to never to ensure that ANSI color codes don't interfere with the | ||
// output. | ||
// TODO: remove this once programmatic run statuses are supported. | ||
std::env::set_var("CARGO_TERM_COLOR", "never"); | ||
// This environment variable is required to test the #[bench] fixture. Note that THIS IS FOR | ||
// TEST CODE ONLY. NEVER USE THIS IN PRODUCTION. | ||
std::env::set_var("RUSTC_BOOTSTRAP", "1"); | ||
|
||
// Disable the tests which check for environment variables being set in `config.toml`, as they | ||
// won't be in the search path when running integration tests. | ||
std::env::set_var("__NEXTEST_NO_CHECK_CARGO_ENV_VARS", "1"); | ||
|
||
// Display empty STDOUT and STDERR lines in the output of failed tests. This | ||
// allows tests which make sure outputs are being displayed to work. | ||
std::env::set_var("__NEXTEST_DISPLAY_EMPTY_OUTPUTS", "1"); | ||
|
||
// Remove OUT_DIR from the environment, as it interferes with tests (some of them expect that | ||
// OUT_DIR isn't set.) | ||
std::env::remove_var("OUT_DIR"); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) The nextest Contributors | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
||
pub mod env; | ||
pub mod nextest_cli; | ||
pub mod seed; |
Oops, something went wrong.