#![allow(
clippy::arc_with_non_send_sync,
clippy::arithmetic_side_effects,
clippy::expect_used,
clippy::indexing_slicing,
clippy::panic,
clippy::redundant_field_names,
clippy::unwrap_used
)]
use std::path::{Path, PathBuf};
use fmi_rs::test_fixtures::download_reference_fmus;
use rstest::*;
fn tests_resources_dir() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/resources")
}
#[fixture]
#[once]
pub fn resources_dir() -> PathBuf {
tests_resources_dir()
}
pub fn resource_path(relative: impl AsRef<Path>) -> PathBuf {
tests_resources_dir().join(relative)
}
#[fixture]
#[once]
pub fn reference_fmus_dir() -> PathBuf {
let reference_fmus_dir = resource_path("Reference-FMUs");
if !reference_fmus_dir.exists() {
download_reference_fmus(&reference_fmus_dir).unwrap();
}
reference_fmus_dir
}