register plugin static in integration test

After a `cargo clean` the shared library is not yet present if the test is started with `cargo test`.
This commit is contained in:
Thijs Vermeir 2018-11-03 23:59:21 +01:00
parent e4acf61af3
commit a8e16d4815
2 changed files with 4 additions and 24 deletions

View file

@ -19,7 +19,7 @@ either = "1.0"
[lib]
name = "gsttogglerecord"
crate-type = ["cdylib"]
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[[example]]

View file

@ -27,35 +27,15 @@ use either::*;
use std::sync::{mpsc, Mutex};
use std::thread;
extern crate gsttogglerecord;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
INIT.call_once(|| {
gst::init().unwrap();
#[cfg(debug_assertions)]
{
use std::path::Path;
let mut path = Path::new("target/debug");
if !path.exists() {
path = Path::new("../target/debug");
}
gst::Registry::get().scan_path(path);
}
#[cfg(not(debug_assertions))]
{
use std::path::Path;
let mut path = Path::new("target/release");
if !path.exists() {
path = Path::new("../target/release");
}
gst::Registry::get().scan_path(path);
}
gsttogglerecord::plugin_register_static();
});
}