#![cfg_attr(coverage_nightly, allow(unused_features))]
#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
#![allow(dead_code)]
mod assertions;
pub mod frame;
mod harness;
mod integration;
mod multi_client;
mod presence;
mod step_test;
pub use {
harness::TestServerHarness,
integration::{IntegrationTest, RegisterInfo, TestResult},
multi_client::{MultiClientTest, TestClient},
presence::{MultiClientPresenceTest, PresenceTestClient},
step_test::{StateSnapshot, StepTest, StepTrace},
};
use std::path::PathBuf;
#[must_use]
#[cfg_attr(coverage_nightly, coverage(off))]
pub fn demo_module_path() -> PathBuf {
let lib_name = demo_module_filename();
let xdg_data_home = std::env::var("XDG_DATA_HOME").map_or_else(
|_| {
std::env::var("HOME")
.map_or_else(|_| PathBuf::new(), |h| PathBuf::from(h).join(".local/share"))
},
PathBuf::from,
);
let xdg_path = xdg_data_home.join("reovim/modules").join(lib_name);
if xdg_path.exists() {
return xdg_path;
}
let manifest_dir = env!("CARGO_MANIFEST_DIR");
let release_path = PathBuf::from(manifest_dir)
.parent()
.expect("lib/testing should have parent directory")
.parent()
.expect("lib should have parent directory")
.join("target/release")
.join(lib_name);
if release_path.exists() {
return release_path;
}
PathBuf::from(manifest_dir)
.parent()
.expect("lib/testing should have parent directory")
.parent()
.expect("lib should have parent directory")
.join("target/debug")
.join(lib_name)
}
#[must_use]
#[cfg_attr(coverage_nightly, coverage(off))]
pub const fn demo_module_filename() -> &'static str {
#[cfg(target_os = "linux")]
{
"libreovim_module_hot_reload_demo.so"
}
#[cfg(target_os = "macos")]
{
"libreovim_module_hot_reload_demo.dylib"
}
#[cfg(target_os = "windows")]
{
"reovim_module_hot_reload_demo.dll"
}
}