Skip to content

Introduce 'cargotest' and the check-cargotest buildstep #32348

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

Merged
merged 1 commit into from
Mar 23, 2016
Merged
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
8 changes: 8 additions & 0 deletions src/bootstrap/build/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
build.run(build.tool_cmd(&compiler, "linkchecker")
.arg(build.out.join(host).join("doc")));
}

pub fn cargotest(build: &Build, stage: u32, host: &str) {
let ref compiler = Compiler::new(stage, host);
build.run(build.tool_cmd(compiler, "cargotest")
.env("RUSTC", build.compiler_path(compiler))
.env("RUSTDOC", build.rustdoc(compiler))
.arg(&build.cargo));
}
6 changes: 6 additions & 0 deletions src/bootstrap/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ impl Build {
compile::tool(self, stage, target.target,
"error_index_generator");
}
ToolCargoTest { stage } => {
compile::tool(self, stage, target.target, "cargotest");
}
DocBook { stage } => {
doc::rustbook(self, stage, target.target, "book", &doc_out);
}
Expand Down Expand Up @@ -210,6 +213,9 @@ impl Build {
CheckLinkcheck { stage } => {
check::linkcheck(self, stage, target.target);
}
CheckCargoTest { stage } => {
check::cargotest(self, stage, target.target);
}

DistDocs { stage } => dist::docs(self, stage, target.target),
DistMingw { _dummy } => dist::mingw(self, target.target),
Expand Down
8 changes: 8 additions & 0 deletions src/bootstrap/build/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ macro_rules! targets {
(tool_linkchecker, ToolLinkchecker { stage: u32 }),
(tool_rustbook, ToolRustbook { stage: u32 }),
(tool_error_index, ToolErrorIndex { stage: u32 }),
(tool_cargotest, ToolCargoTest { stage: u32 }),

// Steps for long-running native builds. Ideally these wouldn't
// actually exist and would be part of build scripts, but for now
Expand All @@ -73,6 +74,7 @@ macro_rules! targets {
// target to depend on a bunch of others.
(check, Check { stage: u32, compiler: Compiler<'a> }),
(check_linkcheck, CheckLinkcheck { stage: u32 }),
(check_cargotest, CheckCargoTest { stage: u32 }),

// Distribution targets, creating tarballs
(dist, Dist { stage: u32 }),
Expand Down Expand Up @@ -292,6 +294,9 @@ impl<'a> Step<'a> {
Source::CheckLinkcheck { stage } => {
vec![self.tool_linkchecker(stage), self.doc(stage)]
}
Source::CheckCargoTest { stage } => {
vec![self.tool_cargotest(stage)]
}

Source::ToolLinkchecker { stage } => {
vec![self.libstd(self.compiler(stage))]
Expand All @@ -300,6 +305,9 @@ impl<'a> Step<'a> {
Source::ToolRustbook { stage } => {
vec![self.librustc(self.compiler(stage))]
}
Source::ToolCargoTest { stage } => {
vec![self.libstd(self.compiler(stage))]
}

Source::DistDocs { stage } => vec![self.doc(stage)],
Source::DistMingw { _dummy: _ } => Vec::new(),
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/mk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ standalone-docs:
$(Q)$(BOOTSTRAP) --step doc-standalone
check:
$(Q)$(BOOTSTRAP) --step check
cargotest:
$(Q)$(BOOTSTRAP) --step cargotest
dist:
$(Q)$(BOOTSTRAP) --step dist

Expand Down
28 changes: 28 additions & 0 deletions src/tools/cargotest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/tools/cargotest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "cargotest"
version = "0.1.0"
authors = ["Brian Anderson <banderson@mozilla.com>"]

[dependencies]
tempdir = "0.3.4"

[[bin]]
name = "cargotest"
path = "main.rs"
Loading