Fix cargo test failing

This commit is contained in:
Imbris 2020-06-19 01:31:15 -04:00
parent 838eadda4e
commit 78bb801216
3 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,9 @@ edition = "2018"
[lib] [lib]
name = "voxygen_anim" name = "voxygen_anim"
crate-type = ["lib", "cdylib"] # Uncomment to use animation hot reloading
# Note: this breaks `cargo test`
#crate-type = ["lib", "cdylib"]
[features] [features]
use-dyn-lib = ["libloading", "notify", "lazy_static", "log"] use-dyn-lib = ["libloading", "notify", "lazy_static", "log"]

View File

@ -57,7 +57,7 @@ pub fn init() {
while let Ok(path) = reload_recv.recv() { while let Ok(path) = reload_recv.recv() {
modified_paths.insert(path); modified_paths.insert(path);
// Wait for to see if there are more modify events before reloading // Wait for any additional modify events before reloading
while let Ok(path) = reload_recv.recv_timeout(Duration::from_millis(300)) { while let Ok(path) = reload_recv.recv_timeout(Duration::from_millis(300)) {
modified_paths.insert(path); modified_paths.insert(path);
} }
@ -80,7 +80,7 @@ pub fn init() {
std::mem::forget(watcher); std::mem::forget(watcher);
} }
// Recompiles and hotreloads the lib if the source is changed // Recompiles and hotreloads the lib if the source has been changed
// Note: designed with voxygen dir as working dir, could be made more flexible // Note: designed with voxygen dir as working dir, could be made more flexible
fn event_fn(res: notify::Result<notify::Event>, sender: &mpsc::Sender<String>) { fn event_fn(res: notify::Result<notify::Event>, sender: &mpsc::Sender<String>) {
match res { match res {
@ -96,7 +96,7 @@ fn event_fn(res: notify::Result<notify::Event>, sender: &mpsc::Sender<String>) {
}, },
_ => {}, _ => {},
}, },
Err(e) => log::error!("Animation hotreload watch error: {:?}", e), Err(e) => log::error!("Animation hotreload watcher error: {:?}", e),
} }
} }

View File

@ -122,7 +122,7 @@ pub trait Animation {
) -> Self::Skeleton; ) -> Self::Skeleton;
/// Calls `update_skeleton_inner` either directly or via `libloading` to /// Calls `update_skeleton_inner` either directly or via `libloading` to
/// produce generate the new skeleton. /// generate the new skeleton.
fn update_skeleton( fn update_skeleton(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
dependency: Self::Dependency, dependency: Self::Dependency,