Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Setup cli testing via integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel committed Apr 11, 2019
1 parent 6b469cc commit 5eb4b82
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target
target
**/*.rs.bk
*.repro
140 changes: 140 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dqcsim-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ structopt = "0.2"
failure = "0.1"
ansi_term = "0.11"
clap = "~2.33.0"

[dev-dependencies]
assert_cmd = "0.11"
predicates = "1.0"
21 changes: 21 additions & 0 deletions dqcsim-cli/src/arg_parse/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,24 @@ fn format_error_ctxt<T>(ctxt: &str, e: impl Into<Error>) -> Result<T, Error> {
)))
.into())
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn debug() {
let c = CommandLineConfiguration {
host_calls: vec![],
host_stdout: true,
dqcsim: SimulatorConfiguration::default().with_seed("test"),
reproduction_file: None,
};

assert_eq!(format!("{:?}", c), "CommandLineConfiguration { host_calls: [], host_stdout: true, dqcsim: SimulatorConfiguration { seed: Seed { value: 14402189752926126668 }, stderr_level: Info, tee_files: [], log_callback: None, dqcsim_level: Trace, plugins: [], reproduction_path_style: Some(Keep) }, reproduction_file: None }");
}

#[test]
fn help() {}

}
3 changes: 0 additions & 3 deletions dqcsim-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,3 @@ fn main() {
Err(_) => 1,
});
}

#[cfg(test)]
mod tests {}
Loading

0 comments on commit 5eb4b82

Please sign in to comment.