add linux sampler

This commit is contained in:
Gregory Terzian 2018-12-03 19:33:25 +08:00 committed by Josh Matthews
parent 0cb87cca13
commit 7bc29205ef
11 changed files with 263 additions and 9 deletions

View file

@ -2,18 +2,28 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#[macro_use]
extern crate lazy_static;
use background_hang_monitor::HangMonitorRegister;
use ipc_channel::ipc;
use msg::constellation_msg::ScriptHangAnnotation;
use msg::constellation_msg::TEST_PIPELINE_ID;
use msg::constellation_msg::{HangAlert, HangAnnotation, HangMonitorAlert};
use msg::constellation_msg::{MonitoredComponentId, MonitoredComponentType};
use std::sync::Mutex;
use std::thread;
use std::time::Duration;
lazy_static! {
static ref SERIAL: Mutex<()> = Mutex::new(());
}
#[test]
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "linux"))]
fn test_sampler() {
let _lock = SERIAL.lock().unwrap();
use msg::constellation_msg::SamplerControlMsg;
use serde_json::Value;
@ -57,6 +67,8 @@ fn test_sampler() {
#[test]
fn test_hang_monitoring() {
let _lock = SERIAL.lock().unwrap();
let (background_hang_monitor_ipc_sender, background_hang_monitor_receiver) =
ipc::channel().expect("ipc channel failure");
let (_sampler_sender, sampler_receiver) = ipc::channel().expect("ipc channel failure");
@ -153,6 +165,8 @@ fn test_hang_monitoring() {
#[test]
fn test_hang_monitoring_unregister() {
let _lock = SERIAL.lock().unwrap();
let (background_hang_monitor_ipc_sender, background_hang_monitor_receiver) =
ipc::channel().expect("ipc channel failure");
let (_sampler_sender, sampler_receiver) = ipc::channel().expect("ipc channel failure");