mirror of
https://gitlab.cern.ch/wotsubo/psboard-qaqc-postprocess.git
synced 2024-11-22 15:21:00 +09:00
42 lines
1.2 KiB
Rust
42 lines
1.2 KiB
Rust
|
mod integrated_test {
|
||
|
use std::path::PathBuf;
|
||
|
|
||
|
use anyhow::Result;
|
||
|
use assert_cmd::{assert::OutputAssertExt, Command};
|
||
|
use predicates::prelude::*;
|
||
|
|
||
|
#[test]
|
||
|
fn full_log() -> Result<()> {
|
||
|
let test_out_dir = assert_fs::TempDir::new()?;
|
||
|
let test_out = PathBuf::new().join(&test_out_dir).join("out.csv");
|
||
|
|
||
|
let mut cmd = Command::cargo_bin("psb-qaqc-parse")?;
|
||
|
cmd.current_dir("tests")
|
||
|
.arg("./example_logs/valid/20240620_083537.log")
|
||
|
.arg(test_out.as_path())
|
||
|
.assert()
|
||
|
.success();
|
||
|
// .failure()
|
||
|
// .stderr(predicate::str::contains("not yet implemented"));
|
||
|
|
||
|
Ok(())
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn partial_log() -> Result<()> {
|
||
|
let test_out_dir = assert_fs::TempDir::new()?;
|
||
|
let test_out = PathBuf::new().join(&test_out_dir).join("out.csv");
|
||
|
|
||
|
let mut cmd = Command::cargo_bin("psb-qaqc-parse")?;
|
||
|
cmd.current_dir("tests")
|
||
|
.arg("./example_logs/valid/20240620_093537.log")
|
||
|
.arg(test_out.as_path())
|
||
|
.assert()
|
||
|
.success();
|
||
|
// .failure()
|
||
|
// .stderr(predicate::str::contains("not yet implemented"));
|
||
|
|
||
|
Ok(())
|
||
|
}
|
||
|
}
|