Enable static linking, libczi is now a submodule.
This commit is contained in:
28
src/lib.rs
28
src/lib.rs
@@ -1,3 +1,5 @@
|
||||
extern crate link_cplusplus;
|
||||
|
||||
mod functions;
|
||||
mod handle;
|
||||
mod interop;
|
||||
@@ -7,7 +9,7 @@ pub mod sys;
|
||||
pub use functions::*;
|
||||
pub use handle::*;
|
||||
pub use interop::*;
|
||||
pub use misc::{LibCZIApiError, RawDataType, PixelType};
|
||||
pub use misc::{LibCZIApiError, PixelType, RawDataType};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
@@ -15,6 +17,7 @@ mod tests {
|
||||
use crate::interop::{LibCZIBuildInformation, ReaderOpenInfo};
|
||||
use anyhow::{Error, Result};
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[test]
|
||||
fn test_libczi_xml() -> Result<()> {
|
||||
@@ -37,9 +40,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_libczi_pyramid_statistics() -> Result<()> {
|
||||
let path = env::home_dir()
|
||||
.unwrap()
|
||||
.join("code/rust/ndbioimage/tests/files/Experiment-2029.czi");
|
||||
let path = PathBuf::from("test-files/Experiment-2029.czi");
|
||||
assert!(path.exists());
|
||||
let czi = CziReader::create()?;
|
||||
let stream = InputStream::create_from_file_utf8(
|
||||
@@ -54,9 +55,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_libczi_document_info() -> Result<()> {
|
||||
let path = env::home_dir()
|
||||
.unwrap()
|
||||
.join("code/rust/ndbioimage/tests/files/Experiment-2029.czi");
|
||||
let path = PathBuf::from("test-files/Experiment-2029.czi");
|
||||
assert!(path.exists());
|
||||
let czi = CziReader::create()?;
|
||||
let stream = InputStream::create_from_file_utf8(
|
||||
@@ -67,16 +66,25 @@ mod tests {
|
||||
let metadata_segment = czi.get_metadata_segment()?;
|
||||
let document_info = metadata_segment.get_czi_document_info()?;
|
||||
let general_document_info = document_info.get_general_document_info()?;
|
||||
println!("xml: {}", &general_document_info[..general_document_info.len().min(100)]);
|
||||
println!(
|
||||
"xml: {}",
|
||||
&general_document_info[..general_document_info.len().min(100)]
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lib_czi_build_information() -> Result<()> {
|
||||
let build_info = LibCZIBuildInformation::get()?;
|
||||
println!("compiler information: {:?}", build_info.get_compiler_information());
|
||||
println!(
|
||||
"compiler information: {:?}",
|
||||
build_info.get_compiler_information()
|
||||
);
|
||||
println!("repository url: {:?}", build_info.get_repository_url());
|
||||
println!("repository branch: {:?}", build_info.get_repository_branch());
|
||||
println!(
|
||||
"repository branch: {:?}",
|
||||
build_info.get_repository_branch()
|
||||
);
|
||||
println!("repository tag: {:?}", build_info.get_repository_tag());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user