pub fn new(tag: &str, i: &mut u16) -> Self {
        println!("running test case {:02?}: {}", i, tag);
        *i += 1;
        info!(
            "==============================================> running test case: {}",
            tag
        );

        let tc = TestCase {
            tag: tag.to_string(),
            snap_file: format!("./tests/integration/tmp/{}.json", tag),
            config_file: format!("./tests/integration/tmp/{}.yml", tag),
            json: HashMap::new(),
            logfile: format!("./tests/integration/tmp/{}.log", tag),
            logfile_gzip: format!("./tests/integration/tmp/{}.log.gz", tag),
            tmpfile: format!("./tests/integration/tmp/{}.txt", tag),
        };

        // safe to delete logfile if any
        let _ = std::fs::remove_file(&tc.logfile);
        let _ = std::fs::remove_file(&tc.logfile_gzip);
        let _ = std::fs::remove_file(&tc.snap_file);
        let _ = std::fs::remove_file(&tc.tmpfile);

        // create dummy log file from the tc name
        tc.create_log(None, false);

        info!("tc={:#?}", tc);

        tc
    }
// a new testcase with the default config
a new testcase with the default config
a new testcase with the default config
pub fn new(tag: &str, i: &mut u16) -> Self {
        println!("running test case {:02?}: {}", i, tag);
        *i += 1;
        info!(
            "==============================================> running test case: {}",
            tag
        );
        let tc = TestCase {
            tag: tag.to_string(),
            snap_file: format!("./tests/integration/tmp/{}.json", tag),
            config_file: format!("./tests/integration/tmp/{}.yml", tag),
            json: HashMap::new(),
            logfile: format!("./tests/integration/tmp/{}.log", tag),
            logfile_gzip: format!("./tests/integration/tmp/{}.log.gz", tag),
            tmpfile: format!("./tests/integration/tmp/{}.txt", tag),
        };
        // safe to delete logfile if any
        let _ = std::fs::remove_file(&tc.logfile);
        let _ = std::fs::remove_file(&tc.logfile_gzip);
        let _ = std::fs::remove_file(&tc.snap_file);
        let _ = std::fs::remove_file(&tc.tmpfile);
        // create dummy log file from the tc name
        tc.create_log(None, false);
        info!("tc={:#?}", tc);
        tc
    }
pub fn new ( tag : & str , i : & mut u16 ) -> Self { println ! ( " " i tag ) ; * i += 1 ; info ! ( " " tag ) ; let tc = TestCase { tag : tag . to_string ( ) , snap_file : format ! ( " " tag ) , config_file : format ! ( " " tag ) , json : HashMap :: new ( ) , logfile : format ! ( " " tag ) , logfile_gzip : format ! ( " " tag ) , tmpfile : format ! ( " " tag ) , } ; // safe to delete logfile if any let _ = std :: fs :: remove_file ( & tc . logfile ) ; let _ = std :: fs :: remove_file ( & tc . logfile_gzip ) ; let _ = std :: fs :: remove_file ( & tc . snap_file ) ; let _ = std :: fs :: remove_file ( & tc . tmpfile ) ; // create dummy log file from the tc name tc . create_log ( None , false ) ; info ! ( " " tc ) ; tc }
a new testcase with the default config
a new testcase with the default config
tag
&str
i
&mut u16
tag
&str
i
&mut u16