Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Integration test template #71

Merged
merged 5 commits into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/README.md
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
```
19 changes: 19 additions & 0 deletions tests/integration.rs
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());
}