Skip to content

Commit

Permalink
Acted on making deployment a dependency of base to verify it was chec…
Browse files Browse the repository at this point in the history
…ked out correctly
  • Loading branch information
francis-starlab committed Sep 10, 2021
1 parent ca756fb commit 4cae394
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions tests/testsuite/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ fn dep_with_submodule() {
"\
[UPDATING] git repository [..]
[UPDATING] git submodule `file://[..]/deployment`
[COMPILING] deployment [..]
[COMPILING] base [..]
[COMPILING] foo [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n",
Expand All @@ -946,17 +947,36 @@ fn dep_with_submodule() {
#[cargo_test]
fn dep_with_relative_submodule() {
let foo = project();
let base = git::new("base/base", |project| {
let base = git::new("base", |project| {
project
.file("Cargo.toml", &basic_lib_manifest("base"))
.file("src/lib.rs", "pub fn dep() {}")
.file(
"Cargo.toml",
r#"
[package]
name = "base"
version = "0.5.0"
[dependencies]
deployment.path = "deployment"
"#,
)
.file(
"src/lib.rs",
r#"
pub fn dep() {
deployment::deployment_func();
}
"#,
)
});
let _deployment = git::new("deployment", |project| {
project.file("src/lib.rs", "pub fn dep() {}")
project
.file("src/lib.rs", "pub fn deployment_func() {}")
.file("Cargo.toml", &basic_lib_manifest("deployment"))
});

let base_repo = git2::Repository::open(&base.root()).unwrap();
git::add_submodule(&base_repo, "../../deployment", Path::new("deployment"));
git::add_submodule(&base_repo, "../deployment", Path::new("deployment"));
git::commit(&base_repo);

let project = foo
Expand All @@ -965,13 +985,10 @@ fn dep_with_relative_submodule() {
&format!(
r#"
[project]
name = "foo"
version = "0.5.0"
authors = ["[email protected]"]
[dependencies.base]
git = '{}'
"#,
base.url()
Expand Down

0 comments on commit 4cae394

Please sign in to comment.