test work

This commit is contained in:
John Smith 2022-12-01 12:26:02 -05:00
parent 9a4ab59ed6
commit e1be2bac67
2 changed files with 8 additions and 30 deletions

View File

@ -2,16 +2,15 @@ use super::native::*;
use crate::*;
use backtrace::Backtrace;
use std::panic;
use tracing_subscriber::{fmt, prelude::*};
use tracing_oslog::OsLogger;
use tracing_subscriber::prelude::*;
#[no_mangle]
#[allow(dead_code)]
pub extern "C" fn run_veilid_core_tests() {
std::thread::spawn(|| {
block_on(async {
veilid_core_setup_ios_tests();
run_all_tests().await;
})
block_on(async {
veilid_core_setup_ios_tests();
run_all_tests().await;
});
}

View File

@ -15,17 +15,8 @@ pub extern "C" fn run_veilid_tools_tests() {
pub fn veilid_tools_setup_ios_tests() {
cfg_if! {
if #[cfg(feature = "tracing")] {
// use tracing_subscriber::{filter, fmt, prelude::*};
// let mut filters = filter::Targets::new();
// for ig in DEFAULT_LOG_IGNORE_LIST {
// filters = filters.with_target(ig, filter::LevelFilter::OFF);
// }
// let fmt_layer = fmt::layer();
// tracing_subscriber::registry()
// .with(filters)
// .with(filter::LevelFilter::TRACE)
// .with(fmt_layer)
// .init();
use tracing_oslog::OsLogger;
use tracing_subscriber::prelude::*;
let mut filters = filter::Targets::new();
for ig in DEFAULT_LOG_IGNORE_LIST {
@ -37,19 +28,7 @@ pub fn veilid_tools_setup_ios_tests() {
.with(OsLogger::new("com.veilid.veilidtools-tests", "default"))
.init();
} else {
// use simplelog::*;
// let mut logs: Vec<Box<dyn SharedLogger>> = Vec::new();
// let mut cb = ConfigBuilder::new();
// for ig in DEFAULT_LOG_IGNORE_LIST {
// cb.add_filter_ignore_str(ig);
// }
// logs.push(TermLogger::new(
// LevelFilter::Trace,
// cb.build(),
// TerminalMode::Mixed,
// ColorChoice::Auto,
// ));
// CombinedLogger::init(logs).expect("logger init error");
use oslog::OsLogger;
OsLogger::new("com.veilid.veilidtools-tests", "default")
.level_filter(LevelFilter::Trace)