-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2274489
commit 577e650
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ use std::thread; | |
use cargo_test_support::paths::{self, CargoPathExt}; | ||
use cargo_test_support::{basic_lib_manifest, basic_manifest, git, main_file, path2url, project}; | ||
use cargo_test_support::{sleep_ms, t, Project}; | ||
use pathdiff::diff_paths; | ||
use std::fs::File; | ||
use regex::Regex; | ||
|
||
fn disable_git_cli() -> bool { | ||
// mingw git on Windows does not support Windows-style file URIs. | ||
|
@@ -943,6 +946,60 @@ fn dep_with_submodule() { | |
.run(); | ||
} | ||
|
||
#[cargo_test] | ||
fn dep_with_relative_submodule() { | ||
|
||
|
||
let foo = project(); | ||
let base = git::new("base/base", |project| { | ||
project.file("Cargo.toml", &basic_lib_manifest("base")) | ||
.file("src/lib.rs", "pub fn dep() {}") | ||
}); | ||
let deployment = git::new("deployment", |project| project.file("src/lib.rs", "pub fn dep() {}")); | ||
|
||
let base_repo = git2::Repository::open(&base.root()).unwrap(); | ||
let temp = base.root().join("../../deployment").canonicalize().unwrap(); | ||
let deployment_url = temp.to_str().unwrap(); | ||
git::add_submodule(&base_repo, "../../deployment", Path::new("deployment")); | ||
git::commit(&base_repo); | ||
|
||
let project = foo | ||
.file( | ||
"Cargo.toml", | ||
&format!( | ||
r#" | ||
[project] | ||
name = "foo" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
[dependencies.base] | ||
git = '{}' | ||
"#, | ||
base.url() | ||
), | ||
) | ||
.file( | ||
"src/lib.rs", | ||
"pub fn foo() { }", | ||
) | ||
.build(); | ||
|
||
project | ||
.cargo("build") | ||
.with_stderr( | ||
"\ | ||
[UPDATING] git repository [..] | ||
[UPDATING] git submodule `file://[..]/dep2` | ||
[COMPILING] dep1 [..] | ||
[COMPILING] foo [..] | ||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", | ||
) | ||
.run(); | ||
} | ||
|
||
#[cargo_test] | ||
fn dep_with_bad_submodule() { | ||
let project = project(); | ||
|