mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-08-24 22:21:43 +02:00
Created tests directory
This commit is contained in:
parent
3cf8a8c431
commit
e6cc8fa59b
@ -1,16 +0,0 @@
|
||||
use std::error::Error;
|
||||
|
||||
mod test;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
println!("============================================");
|
||||
println!(" TREXIO VERSION : {}", trexio::PACKAGE_VERSION );
|
||||
println!("============================================");
|
||||
|
||||
let file_name = "test_write_rust.dir";
|
||||
|
||||
let back_end = trexio::BackEnd::Text;
|
||||
test::test_write(file_name, back_end)?;
|
||||
|
||||
Ok(())
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
use trexio::back_end::BackEnd;
|
||||
use trexio::bitfield::Bitfield;
|
||||
|
||||
pub fn test_write(file_name: &str, back_end: BackEnd) -> Result<(), trexio::ExitCode> {
|
||||
|
||||
let () = trexio::info()?;
|
||||
fn write(file_name: &str, back_end: BackEnd) -> Result<(), trexio::ExitCode> {
|
||||
|
||||
// Prepare data to be written
|
||||
|
||||
@ -123,3 +122,19 @@ pub fn test_write(file_name: &str, back_end: BackEnd) -> Result<(), trexio::Exit
|
||||
trex_file.close()
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn info() {
|
||||
trexio::info();
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn wite_text() {
|
||||
write("test_write.dir", trexio::BackEnd::Text);
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn wite_hdf5() {
|
||||
write("test_write.hdf5", trexio::BackEnd::Hdf5);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user