Skip to content

Make libtest::ERROR_EXIT_CODE const public to not redefine it in rustdoc #144297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ use options::RunStrategy;
use test_result::*;
use time::TestExecTime;

// Process exit code to be used to indicate test failures.
const ERROR_EXIT_CODE: i32 = 101;
/// Process exit code to be used to indicate test failures.
pub const ERROR_EXIT_CODE: i32 = 101;

const SECONDARY_TEST_INVOKER_VAR: &str = "__RUST_TEST_INVOKE";
const SECONDARY_TEST_BENCH_BENCHMARKS_VAR: &str = "__RUST_TEST_BENCH_BENCHMARKS";
Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ pub(crate) fn run_tests(
if nb_errors != 0 {
// We ensure temp dir destructor is called.
std::mem::drop(temp_dir);
// libtest::ERROR_EXIT_CODE is not public but it's the same value.
// FIXME(GuillaumeGomez): Uncomment the next line once #144297 has been merged.
// std::process::exit(test::ERROR_EXIT_CODE);
std::process::exit(101);
}
}
Expand Down
Loading