mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-18 06:00:33 +00:00
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:
parent
e4acf61af3
commit
a8e16d4815
|
@ -19,7 +19,7 @@ either = "1.0"
|
|||
|
||||
[lib]
|
||||
name = "gsttogglerecord"
|
||||
crate-type = ["cdylib"]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[example]]
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue