-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from minakawa-daiki/add-integration-template
Added Integration test template
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Integration test | ||
|
||
## Usage | ||
Here is a preview implementation of the integration test. | ||
|
||
``` | ||
$ cargo test --test integration | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
use std::process::{Command, Stdio}; | ||
|
||
#[test] | ||
fn main() { | ||
let current_dir_path_result = env::current_dir(); | ||
let current_dir_path = match current_dir_path_result { | ||
Ok(path_buf) => path_buf, | ||
Err(_) => panic!("directory is not found"), | ||
}; | ||
let youki_path = current_dir_path.join(PathBuf::from("youki")); | ||
let status = Command::new(youki_path) | ||
.stdout(Stdio::null()) | ||
.arg("-h") | ||
.status() | ||
.expect("failed to execute process"); | ||
assert!(status.success()); | ||
} |