Skip to content

Commit

Permalink
Auto merge of rust-lang#7690 - giraffate:add_test_for_cargo_locate_pr…
Browse files Browse the repository at this point in the history
…oject, r=alexcrichton

Add a test for `cargo locate-project`

There seems to be no test for `cargo locate-project`, so I add the simple test case for this command.
  • Loading branch information
bors committed Dec 10, 2019
2 parents 774d949 + ba74297 commit a4cc273
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/testsuite/locate_project.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Tests for the `cargo locate-project` command.
use cargo_test_support::project;

#[cargo_test]
fn simple() {
let p = project().build();
let root_manifest_path = p.root().join("Cargo.toml");

p.cargo("locate-project")
.with_stdout(format!(
r#"{{"root":"{}"}}"#,
root_manifest_path.to_str().unwrap()
))
.run();
}
1 change: 1 addition & 0 deletions tests/testsuite/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mod install_upgrade;
mod jobserver;
mod list_targets;
mod local_registry;
mod locate_project;
mod lockfile_compat;
mod login;
mod member_errors;
Expand Down

0 comments on commit a4cc273

Please sign in to comment.