From b6c446cd39173bd4d1699d7b2d3ed1469a25e03c Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 30 Nov 2022 22:48:50 -0500 Subject: [PATCH] test debugging --- veilid-core/src/tests/android/mod.rs | 10 ++++------ veilid-core/src/tests/common/test_host_interface.rs | 2 +- veilid-core/src/tests/ios/mod.rs | 11 ++++------- .../veilidcore-tests/ViewController.swift | 2 ++ 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/veilid-core/src/tests/android/mod.rs b/veilid-core/src/tests/android/mod.rs index 96b79aeb..cf75d9f9 100644 --- a/veilid-core/src/tests/android/mod.rs +++ b/veilid-core/src/tests/android/mod.rs @@ -1,3 +1,4 @@ +use super::native::*; use crate::*; use backtrace::Backtrace; use jni::{ @@ -5,9 +6,7 @@ use jni::{ }; use lazy_static::*; use std::panic; -use tracing::*; -use tracing_subscriber::prelude::*; -use tracing_subscriber::*; +use tracing_subscriber::{filter, fmt, prelude::*}; #[no_mangle] #[allow(non_snake_case)] @@ -22,12 +21,11 @@ pub extern "system" fn Java_com_veilid_veilid_1core_1android_1tests_MainActivity pub fn veilid_core_setup_android_tests(env: JNIEnv, ctx: JObject) { // Set up subscriber and layers - use tracing_subscriber::{filter, fmt, prelude::*}; let filter = VeilidLayerFilter::new(VeilidConfigLogLevel::Trace, None); let layer = tracing_android::layer("veilid-core").expect("failed to set up android logging"); tracing_subscriber::registry() - .with(filters) - .with(fmt_layer) + .with(filter) + .with(layer) .init(); // Set up panic hook for backtraces diff --git a/veilid-core/src/tests/common/test_host_interface.rs b/veilid-core/src/tests/common/test_host_interface.rs index 83618b7f..d1a52cdc 100644 --- a/veilid-core/src/tests/common/test_host_interface.rs +++ b/veilid-core/src/tests/common/test_host_interface.rs @@ -18,7 +18,7 @@ cfg_if! { let t2 = get_timestamp(); let tdiff = ((t2 - t1) as f64)/1000000.0f64; info!("running network interface test with {} iterations took {} seconds", count, tdiff); - info!("interfaces: {:#?}", interfaces) + //info!("interfaces: {:#?}", interfaces) } } } diff --git a/veilid-core/src/tests/ios/mod.rs b/veilid-core/src/tests/ios/mod.rs index bbbe7a59..b00554c1 100644 --- a/veilid-core/src/tests/ios/mod.rs +++ b/veilid-core/src/tests/ios/mod.rs @@ -1,6 +1,8 @@ +use super::native::*; use crate::*; use backtrace::Backtrace; use std::panic; +use tracing_subscriber::{fmt, prelude::*}; #[no_mangle] #[allow(dead_code)] @@ -11,14 +13,9 @@ pub extern "C" fn run_veilid_core_tests() { pub fn veilid_core_setup_ios_tests() { // Set up subscriber and layers - use tracing_subscriber::{filter, fmt, prelude::*}; let filter = VeilidLayerFilter::new(VeilidConfigLogLevel::Trace, None); - let fmt_layer = fmt::layer(); - let layer = tracing_android::layer("veilid-core").expect("failed to set up android logging"); - tracing_subscriber::registry() - .with(filters) - .with(fmt_layer) - .init(); + let fmt_layer = fmt::layer().with_filter(filter); + tracing_subscriber::registry().with(fmt_layer).init(); panic::set_hook(Box::new(|panic_info| { let bt = Backtrace::new(); diff --git a/veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/ViewController.swift b/veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/ViewController.swift index dd663282..66ffe67e 100644 --- a/veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/ViewController.swift +++ b/veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/ViewController.swift @@ -6,12 +6,14 @@ // import UIKit +import Darwin class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() run_veilid_core_tests() + exit(0) }