Skip to content

Commit

Permalink
Debug freebsd error
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jan 30, 2023
1 parent 8bbba5b commit 01aec90
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
23 changes: 12 additions & 11 deletions ci/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,18 @@ run_download_pkg_test() {
}

if [ -z "$SKIP_TESTS" ]; then
cargo run --locked --release --target "$TARGET" "${FEATURES[@]}" -- --dump-testament
run_download_pkg_test
runtest --bin rustup-init
runtest --lib --all
runtest --doc --all
runtest --test cli-rustup -- recursive_cargo
# cargo run --locked --release --target "$TARGET" "${FEATURES[@]}" -- --dump-testament
# run_download_pkg_test
# runtest --bin rustup-init
# runtest --lib --all
# runtest --doc --all

runtest --test dist -- --test-threads 1
# runtest --test dist -- --test-threads 1

find tests -maxdepth 1 -type f ! -path '*/dist.rs' -name '*.rs' \
| sed -e 's@^tests/@@;s@\.rs$@@g' \
| while read -r test; do
runtest --test "${test}"
done
# find tests -maxdepth 1 -type f ! -path '*/dist.rs' -name '*.rs' \
# | sed -e 's@^tests/@@;s@\.rs$@@g' \
# | while read -r test; do
# runtest --test "${test}"
# done
fi
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ macro_rules! for_host {
};
}

#[derive(Clone)]
#[derive(Debug, Clone)]
/// The smallest form of test isolation: an isolated RUSTUP_HOME, for codepaths
/// that read and write config files but do not invoke processes, download data
/// etc.
Expand Down
6 changes: 5 additions & 1 deletion tests/cli-rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ fn fallback_cargo_calls_correct_rustc() {
#[test]
fn recursive_cargo() {
setup(&|config| {
eprintln!("{:#?}", config);
expect_ok(config, &["rustup", "default", "nightly"]);

// We need an intermediary to run cargo itself.
Expand All @@ -583,8 +584,11 @@ fn recursive_cargo() {
let real_mock_cargo = output.stdout.trim();
let cargo_bin_path = config.cargodir.join("bin");
let cargo_subcommand = cargo_bin_path.join(format!("cargo-foo{}", EXE_SUFFIX));
eprintln!("real_mock_carg={real_mock_cargo:?}");
eprintln!("cargo_bin_path={cargo_bin_path:?}");
eprintln!("cargo_subcommand={cargo_subcommand:?}");
fs::create_dir_all(&cargo_bin_path).unwrap();
fs::hard_link(&real_mock_cargo, &cargo_subcommand).unwrap();
fs::copy(&real_mock_cargo, &cargo_subcommand).unwrap();

expect_stdout_ok(
config,
Expand Down
1 change: 1 addition & 0 deletions tests/mock/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::mock::topical_doc_data;
use crate::mock::{MockComponentBuilder, MockFile, MockInstallerBuilder};

/// The configuration used by the tests in this module
#[derive(Debug)]
pub struct Config {
/// Where we put the rustup / rustc / cargo bins
pub exedir: PathBuf,
Expand Down
1 change: 1 addition & 0 deletions tests/mock/mock_bin_src.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fn main() {
let me = env::current_exe().unwrap();
let mut version_file = PathBuf::from(format!("{}.version", me.display()));
let mut hash_file = PathBuf::from(format!("{}.version-hash", me.display()));
eprintln!("{version_file:?}");
if !version_file.exists() {
// There's a "MAJOR HACKS" statement in `toolchain.rs` right
// now where custom toolchains use a `cargo.exe` that's
Expand Down

0 comments on commit 01aec90

Please sign in to comment.