mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-02 14:12:20 +00:00
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:
parent
73a7be5ef5
commit
4fb18382c2
6 changed files with 16 additions and 116 deletions
|
@ -24,7 +24,7 @@ net2 = "0.2"
|
|||
|
||||
[lib]
|
||||
name = "gstthreadshare"
|
||||
crate-type = ["cdylib"]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[example]]
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue