Skip to content

Commit

Permalink
Merge branch 'hackathon' of https://github.com/arlosi/cargo into hack…
Browse files Browse the repository at this point in the history
…athon
  • Loading branch information
dpaoliello committed Sep 13, 2023
2 parents bda6879 + e4c28bf commit d4892a9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/cargo-test-support/src/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ fn normalize_windows(text: &str, cwd: Option<&Path>) -> String {
fn substitute_macros(input: &str) -> String {
let macros = [
("[RUNNING]", " Running"),
("[CACHED]", " Cached"),
("[COMPILING]", " Compiling"),
("[CHECKING]", " Checking"),
("[COMPLETED]", " Completed"),
Expand Down
39 changes: 39 additions & 0 deletions tests/testsuite/cache.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! Tests for per-user caching.

use cargo_test_support::project;
use cargo_test_support::registry::Package;

#[cargo_test]
fn simple() {
Package::new("bar", "0.1.0").publish();
Package::new("baz", "0.2.0").publish();

let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.0.1"
authors = []
[dependencies]
bar = { version = "0.1.0" }
baz = { version = "0.2.0" }
"#,
)
.file("src/lib.rs", "extern crate bar; extern crate baz;")
.build();

p.cargo("build").run();
p.cargo("clean").run();
p.cargo("build")
.with_stderr(
"\
[CACHED] bar v0.1.0
[CACHED] baz v0.2.0
[COMPILING] foo v0.0.1 [..]
[FINISHED] [..]",
)
.run();
}
1 change: 1 addition & 0 deletions tests/testsuite/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mod build_plan;
mod build_script;
mod build_script_env;
mod build_script_extra_link_arg;
mod cache;
mod cache_messages;
mod cargo;
mod cargo_add;
Expand Down

0 comments on commit d4892a9

Please sign in to comment.