threadshare: 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:
Sebastian Dröge 2018-11-05 13:47:34 +02:00
parent 73a7be5ef5
commit 4fb18382c2
6 changed files with 16 additions and 116 deletions

View file

@ -24,7 +24,7 @@ net2 = "0.2"
[lib]
name = "gstthreadshare"
crate-type = ["cdylib"]
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[[example]]

View file

@ -23,35 +23,15 @@ use gst::prelude::*;
use std::sync::{Arc, Mutex};
extern crate gstthreadshare;
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);
}
gstthreadshare::plugin_register_static();
});
}

View file

@ -23,35 +23,15 @@ use gst::prelude::*;
use std::sync::{Arc, Mutex};
extern crate gstthreadshare;
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);
}
gstthreadshare::plugin_register_static();
});
}

View file

@ -23,35 +23,15 @@ use gst::prelude::*;
use std::sync::{Arc, Mutex};
extern crate gstthreadshare;
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);
}
gstthreadshare::plugin_register_static();
});
}

View file

@ -26,35 +26,15 @@ use std::io::Write;
use std::sync::{Arc, Mutex};
use std::{thread, time};
extern crate gstthreadshare;
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);
}
gstthreadshare::plugin_register_static();
});
}

View file

@ -24,35 +24,15 @@ use gst::prelude::*;
use std::sync::{Arc, Mutex};
use std::thread;
extern crate gstthreadshare;
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);
}
gstthreadshare::plugin_register_static();
});
}