Skip to content
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
66 changes: 66 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,21 @@ dependencies = [
"winnow 0.7.13",
]

[[package]]
name = "assert_cmd"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcbb6924530aa9e0432442af08bbcafdad182db80d2e560da42a6d442535bf85"
dependencies = [
"anstyle",
"bstr",
"libc",
"predicates",
"predicates-core",
"predicates-tree",
"wait-timeout",
]

[[package]]
name = "autocfg"
version = "1.5.0"
Expand Down Expand Up @@ -1151,6 +1166,12 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"

[[package]]
name = "difflib"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"

[[package]]
name = "digest"
version = "0.10.7"
Expand Down Expand Up @@ -2982,6 +3003,33 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"

[[package]]
name = "predicates"
version = "3.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573"
dependencies = [
"anstyle",
"difflib",
"predicates-core",
]

[[package]]
name = "predicates-core"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa"

[[package]]
name = "predicates-tree"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c"
dependencies = [
"predicates-core",
"termtree",
]

[[package]]
name = "prettydiff"
version = "0.7.0"
Expand Down Expand Up @@ -3262,6 +3310,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "remote-test-client"
version = "0.1.0"
dependencies = [
"assert_cmd",
]

[[package]]
name = "remote-test-server"
Expand Down Expand Up @@ -5458,6 +5509,12 @@ dependencies = [
"windows-sys 0.60.2",
]

[[package]]
name = "termtree"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"

[[package]]
name = "test-float-parse"
version = "0.1.0"
Expand Down Expand Up @@ -6076,6 +6133,15 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"

[[package]]
name = "wait-timeout"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
dependencies = [
"libc",
]

[[package]]
name = "walkdir"
version = "2.5.0"
Expand Down
37 changes: 37 additions & 0 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4003,3 +4003,40 @@ impl Step for CollectLicenseMetadata {
dest
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RemoteTestClientTests {
host: TargetSelection,
}

impl Step for RemoteTestClientTests {
type Output = ();
const IS_HOST: bool = true;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/remote-test-client")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Self { host: run.target });
}

fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(0, bootstrap_host);

let cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolBootstrap,
bootstrap_host,
Kind::Test,
"src/tools/remote-test-client",
SourceType::InTree,
&[],
);

run_cargo_test(cargo, &[], &[], "remote-test-client", bootstrap_host, builder);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test
---
[Test] test::Tidy
Expand Down Expand Up @@ -158,6 +159,9 @@ expression: test
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
- Set({test::tidyselftest})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=coverage
---
[Test] test::Tidy
Expand Down Expand Up @@ -157,6 +158,9 @@ expression: test --skip=coverage
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
- Set({test::tidyselftest})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=tests
---
[Test] test::Tidy
Expand Down Expand Up @@ -121,6 +122,9 @@ expression: test --skip=tests
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
- Set({test::tidyselftest})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=tests --skip=coverage-map --skip=coverage-run --skip=library --skip=tidyselftest
---
[Test] test::Tidy
Expand Down Expand Up @@ -100,6 +101,9 @@ expression: test --skip=tests --skip=coverage-map --skip=coverage-run --skip=lib
- Set({test::src/tools/coverage-dump})
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ impl<'a> Builder<'a> {
test::CrateRustdoc,
test::CrateRustdocJsonTypes,
test::CrateBootstrap,
test::RemoteTestClientTests,
test::Linkcheck,
test::TierCheck,
test::Cargotest,
Expand Down
1 change: 1 addition & 0 deletions src/tools/remote-test-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]
assert_cmd = "2"
10 changes: 10 additions & 0 deletions src/tools/remote-test-client/tests/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[test]
fn test_help() {
let mut cmd = assert_cmd::cargo::cargo_bin_cmd!();
cmd.arg("help");

let output = cmd.unwrap();

let stdout = String::from_utf8(output.stdout.clone()).unwrap();
assert!(stdout.trim().starts_with("Usage:"));
}
Loading