This commit is contained in:
John Smith 2022-11-27 22:33:41 -05:00
parent a34da6ff75
commit d99273334d
66 changed files with 374 additions and 254 deletions

3
Cargo.lock generated
View file

@ -5759,7 +5759,7 @@ dependencies = [
"rand 0.7.3", "rand 0.7.3",
"send_wrapper 0.6.0", "send_wrapper 0.6.0",
"serial_test", "serial_test",
"simplelog 0.9.0", "simplelog 0.12.0",
"static_assertions", "static_assertions",
"stop-token", "stop-token",
"thiserror", "thiserror",
@ -5767,6 +5767,7 @@ dependencies = [
"tokio-util", "tokio-util",
"tracing", "tracing",
"tracing-android", "tracing-android",
"tracing-subscriber",
"tracing-wasm", "tracing-wasm",
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",

View file

@ -46,22 +46,23 @@ pub fn veilid_core_setup_android<'a>(
log_tag: &'a str, log_tag: &'a str,
log_level: VeilidConfigLogLevel, log_level: VeilidConfigLogLevel,
) { ) {
// Set up subscriber and layers cfg_if! {
let subscriber = Registry::default(); if #[cfg(feature = "tracing")] {
let mut layers = Vec::new(); // Set up subscriber and layers
let mut filters = BTreeMap::new(); let subscriber = Registry::default();
let filter = VeilidLayerFilter::new(log_level, None); let mut layers = Vec::new();
let layer = tracing_android::layer(log_tag) let filter = VeilidLayerFilter::new(log_level, None);
.expect("failed to set up android logging") let layer = tracing_android::layer(log_tag)
.with_filter(filter.clone()); .expect("failed to set up android logging")
filters.insert("system", filter); .with_filter(filter.clone());
layers.push(layer.boxed()); layers.push(layer.boxed());
let subscriber = subscriber.with(layers);
subscriber
.try_init()
.expect("failed to init android tracing");
let subscriber = subscriber.with(layers);
subscriber
.try_init()
.expect("failed to init android tracing");
}
}
// Set up panic hook for backtraces // Set up panic hook for backtraces
panic::set_hook(Box::new(|panic_info| { panic::set_hook(Box::new(|panic_info| {
let bt = Backtrace::new(); let bt = Backtrace::new();

View file

@ -1,83 +0,0 @@
//! Test suite for NodeJS
#![cfg(target_arch = "wasm32")]
use veilid_core::tests::common::*;
use veilid_core::xx::*;
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!();
extern crate wee_alloc;
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
static SETUP_ONCE: Once = Once::new();
pub fn setup() -> () {
SETUP_ONCE.call_once(|| {
console_error_panic_hook::set_once();
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
});
}
#[wasm_bindgen_test]
async fn run_test_dht_key() {
setup();
test_dht_key::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_host_interface() {
setup();
test_host_interface::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_veilid_core() {
setup();
test_veilid_core::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_config() {
setup();
test_veilid_config::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_connection_table() {
setup();
test_connection_table::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_table_store() {
setup();
test_table_store::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_crypto() {
setup();
test_crypto::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_envelope_receipt() {
setup();
test_envelope_receipt::test_all().await;
}
#[wasm_bindgen_test]
async fn run_test_async_tag_lock() {
setup();
test_async_tag_lock::test_all().await;
}

View file

@ -6,22 +6,23 @@ edition = "2021"
license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)" license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)"
[lib] [lib]
crate-type = ["rlib"] # Staticlib for iOS tests, rlib for everything else
crate-type = [ "staticlib", "rlib" ]
[features] [features]
default = [ "tracing" ] default = []
rt-async-std = [ "async-std", "async_executors/async_std", ] rt-async-std = [ "async-std", "async_executors/async_std", ]
rt-tokio = [ "tokio", "tokio-util", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", ] rt-tokio = [ "tokio", "tokio-util", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", ]
android_tests = [] android_tests = []
ios_tests = [ "simplelog" ] ios_tests = []
tracking = [] tracking = []
tracing = [ "dep:tracing" ] tracing = [ "dep:tracing", "dep:tracing-subscriber" ]
log = [ "dep:log" ]
[dependencies] [dependencies]
tracing = { version = "^0", features = ["log", "attributes"], optional = true } tracing = { version = "^0", features = ["log", "attributes"], optional = true }
log = { version = "^0", optional = true } tracing-subscriber = { version = "^0", optional = true }
log = { version = "^0" }
eyre = "^0" eyre = "^0"
static_assertions = "^1" static_assertions = "^1"
cfg-if = "^1" cfg-if = "^1"
@ -31,7 +32,7 @@ parking_lot = "^0"
once_cell = "^1" once_cell = "^1"
owo-colors = "^3" owo-colors = "^3"
stop-token = { version = "^0", default-features = false } stop-token = { version = "^0", default-features = false }
rand = "0.7" rand = "^0.7"
# Dependencies for native builds only # Dependencies for native builds only
# Linux, Windows, Mac, iOS, Android # Linux, Windows, Mac, iOS, Android
@ -69,15 +70,13 @@ tracing-android = { version = "^0", optional = true }
# Dependencies for iOS # Dependencies for iOS
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
simplelog = { version = "^0", optional = true } simplelog = { version = "^0.12", features = [ "test" ] }
### DEV DEPENDENCIES ### DEV DEPENDENCIES
[dev-dependencies] [dev-dependencies]
serial_test = "^0" serial_test = "^0"
simplelog = { version = "^0.12", features = [ "test" ] }
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
simplelog = { version = "^0", features=["test"] }
[target.'cfg(target_arch = "wasm32")'.dev-dependencies] [target.'cfg(target_arch = "wasm32")'.dev-dependencies]
console_error_panic_hook = "^0" console_error_panic_hook = "^0"
@ -91,3 +90,8 @@ parking_lot = { version = "^0", features = ["wasm-bindgen"]}
[package.metadata.wasm-pack.profile.release] [package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-mutable-globals"] wasm-opt = ["-O", "--enable-mutable-globals"]
[package.metadata.ios]
build_targets = ["aarch64-apple-ios", "aarch64-apple-ios-sim", "x86_64-apple-ios"]
deployment_target = "12.0"
build_id_prefix = "com.veilid.veilidtools"

View file

@ -1,20 +1,36 @@
#!/bin/bash #!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CARGO_MANIFEST_PATH=$(python -c "import os; print(os.path.realpath(\"$SCRIPTDIR/Cargo.toml\"))") CARGO_MANIFEST_PATH=$(python3 -c "import os; print(os.path.realpath(\"$SCRIPTDIR/Cargo.toml\"))")
TARGET_PATH=$(python3 -c "import os; print(os.path.realpath(\"$SCRIPTDIR/../target\"))")
PACKAGE_NAME=$1
shift
# echo CARGO_MANIFEST_PATH: $CARGO_MANIFEST_PATH # echo CARGO_MANIFEST_PATH: $CARGO_MANIFEST_PATH
if [ "$CONFIGURATION" == "Debug" ]; then if [ "$CONFIGURATION" == "Debug" ]; then
EXTRA_CARGO_OPTIONS="$@" EXTRA_CARGO_OPTIONS="$@"
BUILD_MODE="debug"
else else
EXTRA_CARGO_OPTIONS="$@ --release" EXTRA_CARGO_OPTIONS="$@ --release"
BUILD_MODE="release"
fi fi
ARCHS=${ARCHS:=arm64} ARCHS=${ARCHS:=arm64}
if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then
LIPO_OUT_NAME="lipo-ios-sim"
else
LIPO_OUT_NAME="lipo-ios"
fi
for arch in $ARCHS for arch in $ARCHS
do do
if [ "$arch" == "arm64" ]; then if [ "$arch" == "arm64" ]; then
echo arm64 echo arm64
CARGO_TARGET=aarch64-apple-ios if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then
CARGO_TARGET=aarch64-apple-ios-sim
else
CARGO_TARGET=aarch64-apple-ios
fi
#CARGO_TOOLCHAIN=+ios-arm64-1.57.0 #CARGO_TOOLCHAIN=+ios-arm64-1.57.0
CARGO_TOOLCHAIN= CARGO_TOOLCHAIN=
elif [ "$arch" == "x86_64" ]; then elif [ "$arch" == "x86_64" ]; then
@ -40,5 +56,10 @@ do
fi fi
env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
LIPOS="$LIPOS $TARGET_PATH/$CARGO_TARGET/$BUILD_MODE/lib$PACKAGE_NAME.a"
done done
mkdir -p "$TARGET_PATH/$LIPO_OUT_NAME/$BUILD_MODE/"
lipo $LIPOS -create -output "$TARGET_PATH/$LIPO_OUT_NAME/$BUILD_MODE/lib$PACKAGE_NAME.a"

View file

@ -1,9 +1,26 @@
#!/bin/bash #!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd $SCRIPTDIR 2>/dev/null
if [[ "$1" == "wasm" ]]; then if [[ "$1" == "wasm" ]]; then
WASM_BINDGEN_TEST_TIMEOUT=120 wasm-pack test --chrome --headless WASM_BINDGEN_TEST_TIMEOUT=120 wasm-pack test --chrome --headless
elif [[ "$1" == "ios" ]]; then
SYMROOT=/tmp/testout
APPNAME=veilidtools-tests
BUNDLENAME=com.veilid.veilidtools-tests
xcrun xcodebuild -project src/tests/ios/$APPNAME/$APPNAME.xcodeproj/ -scheme $APPNAME -destination "generic/platform=iOS Simulator" SYMROOT=$SYMROOT
ID=$(xcrun simctl create test-iphone com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro com.apple.CoreSimulator.SimRuntime.iOS-16-1 2>/dev/null)
xcrun simctl boot $ID
xcrun simctl bootstatus $ID
xcrun simctl install $ID $SYMROOT/Debug-iphonesimulator/$APPNAME.app
xcrun simctl launch --console $ID $BUNDLENAME
xcrun simctl delete all
rm -rf /tmp/testout
else else
cargo test --features=rt-tokio cargo test --features=rt-tokio
cargo test --features=rt-async-std cargo test --features=rt-async-std
cargo test --features=rt-tokio,log --no-default-features cargo test --features=rt-tokio,log --no-default-features
cargo test --features=rt-async-std,log --no-default-features cargo test --features=rt-async-std,log --no-default-features
fi fi
popd 2>/dev/null

View file

@ -136,3 +136,10 @@ pub use wasm::*;
// Tests must be public for wasm-pack tests // Tests must be public for wasm-pack tests
pub mod tests; pub mod tests;
// For iOS tests
#[no_mangle]
pub extern "C" fn main_rs() {
// start game code here
}

View file

@ -0,0 +1,80 @@
use super::*;
use jni::errors::Result as JniResult;
use jni::{objects::GlobalRef, objects::JObject, objects::JString, JNIEnv, JavaVM};
use lazy_static::*;
use std::backtrace::Backtrace;
use std::panic;
use tracing::*;
use tracing_subscriber::prelude::*;
use tracing_subscriber::*;
pub struct AndroidGlobals {
pub vm: JavaVM,
pub ctx: GlobalRef,
}
impl Drop for AndroidGlobals {
fn drop(&mut self) {
// Ensure we're attached before dropping GlobalRef
self.vm.attach_current_thread_as_daemon().unwrap();
}
}
lazy_static! {
pub static ref ANDROID_GLOBALS: Arc<Mutex<Option<AndroidGlobals>>> = Arc::new(Mutex::new(None));
}
pub fn veilid_tools_setup_android_no_log<'a>(env: JNIEnv<'a>, ctx: JObject<'a>) {
*ANDROID_GLOBALS.lock() = Some(AndroidGlobals {
vm: env.get_java_vm().unwrap(),
ctx: env.new_global_ref(ctx).unwrap(),
});
}
pub fn veilid_tools_setup<'a>(env: JNIEnv<'a>, ctx: JObject<'a>, log_tag: &'a str) {
cfg_if! {
if #[cfg(feature = "tracing")] {
// Set up subscriber and layers
let subscriber = Registry::default();
let mut layers = Vec::new();
let layer = tracing_android::layer(log_tag)
.expect("failed to set up android logging")
.with_filter(LevelFilter::TRACE);
layers.push(layer.boxed());
let subscriber = subscriber.with(layers);
subscriber
.try_init()
.expect("failed to init android tracing");
}
}
// Set up panic hook for backtraces
panic::set_hook(Box::new(|panic_info| {
let bt = Backtrace::capture();
error!("Backtrace:\n{:?}", bt);
}));
veilid_core_setup_android_no_log(env, ctx);
}
pub fn get_android_globals() -> (JavaVM, GlobalRef) {
let globals_locked = ANDROID_GLOBALS.lock();
let globals = globals_locked.as_ref().unwrap();
let env = globals.vm.attach_current_thread_as_daemon().unwrap();
let vm = env.get_java_vm().unwrap();
let ctx = globals.ctx.clone();
(vm, ctx)
}
pub fn with_null_local_frame<'b, T, F>(env: JNIEnv<'b>, s: i32, f: F) -> JniResult<T>
where
F: FnOnce() -> JniResult<T>,
{
env.push_local_frame(s)?;
let out = f();
env.pop_local_frame(JObject::null())?;
out
}

View file

@ -1,2 +1,27 @@
pub mod test_async_tag_lock; pub mod test_async_tag_lock;
pub mod test_host_interface; pub mod test_host_interface;
#[allow(dead_code)]
pub static DEFAULT_LOG_IGNORE_LIST: [&str; 21] = [
"mio",
"h2",
"hyper",
"tower",
"tonic",
"tokio",
"runtime",
"tokio_util",
"want",
"serial_test",
"async_std",
"async_io",
"polling",
"rustls",
"async_tungstenite",
"tungstenite",
"netlink_proto",
"netlink_sys",
"trust_dns_resolver",
"trust_dns_proto",
"attohttpc",
];

View file

@ -0,0 +1,61 @@
use super::*;
use std::backtrace::Backtrace;
use std::panic;
pub fn veilid_tools_setup<'a>() -> Result<(), String> {
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();
} 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).map_err(|e| format!("logger init error: {}", e))?;
}
}
panic::set_hook(Box::new(|panic_info| {
let bt = Backtrace::capture();
if let Some(location) = panic_info.location() {
error!(
"panic occurred in file '{}' at line {}",
location.file(),
location.line(),
);
} else {
error!("panic occurred but can't get location information...");
}
if let Some(s) = panic_info.payload().downcast_ref::<&str>() {
error!("panic payload: {:?}", s);
} else if let Some(s) = panic_info.payload().downcast_ref::<String>() {
error!("panic payload: {:?}", s);
} else if let Some(a) = panic_info.payload().downcast_ref::<std::fmt::Arguments>() {
error!("panic payload: {:?}", a);
} else {
error!("no panic payload");
}
error!("Backtrace:\n{:?}", bt);
}));
Ok(())
}

View file

@ -7,31 +7,31 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
4317C6BD2694A676009C717F /* veilid-tools.c in Sources */ = {isa = PBXBuildFile; fileRef = 4317C6BC2694A676009C717F /* veilid-tools.c */; }; 4317C6BD3694A676009C717F /* (null) in Sources */ = {isa = PBXBuildFile; };
43C436B0268904AC002D11C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C436AF268904AC002D11C5 /* AppDelegate.swift */; }; 43C436B0368904AC002D11C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C436AF368904AC002D11C5 /* AppDelegate.swift */; };
43C436B2268904AC002D11C5 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C436B1268904AC002D11C5 /* SceneDelegate.swift */; }; 43C436B2368904AC002D11C5 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C436B1368904AC002D11C5 /* SceneDelegate.swift */; };
43C436B4268904AC002D11C5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C436B3268904AC002D11C5 /* ViewController.swift */; }; 43C436B4368904AC002D11C5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C436B3368904AC002D11C5 /* ViewController.swift */; };
43C436B7268904AC002D11C5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43C436B5268904AC002D11C5 /* Main.storyboard */; }; 43C436B7368904AC002D11C5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43C436B5368904AC002D11C5 /* Main.storyboard */; };
43C436B9268904AD002D11C5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 43C436B8268904AD002D11C5 /* Assets.xcassets */; }; 43C436B9368904AD002D11C5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 43C436B8368904AD002D11C5 /* Assets.xcassets */; };
43C436BC268904AD002D11C5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43C436BA268904AD002D11C5 /* LaunchScreen.storyboard */; }; 43C436BC368904AD002D11C5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43C436BA368904AD002D11C5 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
4317C6BA2694A675009C717F /* veilidtools-tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "veilidtools-tests-Bridging-Header.h"; sourceTree = "<group>"; }; 4317C6BA3694A675009C717F /* veilidtools-tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "veilidtools-tests-Bridging-Header.h"; sourceTree = "<group>"; };
4317C6BB2694A676009C717F /* veilid-tools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "veilid-tools.h"; sourceTree = "<group>"; }; 4317C6BB3694A676009C717F /* veilid-tools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "veilid-tools.h"; sourceTree = "<group>"; };
4317C6BC2694A676009C717F /* veilid-tools.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "veilid-tools.c"; sourceTree = "<group>"; }; 4317C6BC3694A676009C717F /* veilid-tools.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "veilid-tools.c"; sourceTree = "<group>"; };
43C436AC268904AC002D11C5 /* veilidtools-tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "veilidtools-tests.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 43C436AC368904AC002D11C5 /* veilidtools-tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "veilidtools-tests.app"; sourceTree = BUILT_PRODUCTS_DIR; };
43C436AF268904AC002D11C5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 43C436AF368904AC002D11C5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
43C436B1268904AC002D11C5 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; 43C436B1368904AC002D11C5 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
43C436B3268904AC002D11C5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 43C436B3368904AC002D11C5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
43C436B6268904AC002D11C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 43C436B6368904AC002D11C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
43C436B8268904AD002D11C5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 43C436B8368904AD002D11C5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
43C436BB268904AD002D11C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 43C436BB368904AD002D11C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
43C436BD268904AD002D11C5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 43C436BD368904AD002D11C5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
43C436A9268904AC002D11C5 /* Frameworks */ = { 43C436A9368904AC002D11C5 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -41,43 +41,43 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
4317C6B7269490DA009C717F /* Frameworks */ = { 4317C6B7369490DA009C717F /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
43C436A3268904AC002D11C5 = { 43C436A3368904AC002D11C5 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
4317C6BB2694A676009C717F /* veilid-tools.h */, 4317C6BB3694A676009C717F /* veilid-tools.h */,
4317C6BC2694A676009C717F /* veilid-tools.c */, 4317C6BC3694A676009C717F /* veilid-tools.c */,
43C436AE268904AC002D11C5 /* veilidtools-tests */, 43C436AE368904AC002D11C5 /* veilidtools-tests */,
43C436AD268904AC002D11C5 /* Products */, 43C436AD368904AC002D11C5 /* Products */,
4317C6B7269490DA009C717F /* Frameworks */, 4317C6B7369490DA009C717F /* Frameworks */,
4317C6BA2694A675009C717F /* veilidtools-tests-Bridging-Header.h */, 4317C6BA3694A675009C717F /* veilidtools-tests-Bridging-Header.h */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
43C436AD268904AC002D11C5 /* Products */ = { 43C436AD368904AC002D11C5 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
43C436AC268904AC002D11C5 /* veilidtools-tests.app */, 43C436AC368904AC002D11C5 /* veilidtools-tests.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
43C436AE268904AC002D11C5 /* veilidtools-tests */ = { 43C436AE368904AC002D11C5 /* veilidtools-tests */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
43C436AF268904AC002D11C5 /* AppDelegate.swift */, 43C436AF368904AC002D11C5 /* AppDelegate.swift */,
43C436B1268904AC002D11C5 /* SceneDelegate.swift */, 43C436B1368904AC002D11C5 /* SceneDelegate.swift */,
43C436B3268904AC002D11C5 /* ViewController.swift */, 43C436B3368904AC002D11C5 /* ViewController.swift */,
43C436B5268904AC002D11C5 /* Main.storyboard */, 43C436B5368904AC002D11C5 /* Main.storyboard */,
43C436B8268904AD002D11C5 /* Assets.xcassets */, 43C436B8368904AD002D11C5 /* Assets.xcassets */,
43C436BA268904AD002D11C5 /* LaunchScreen.storyboard */, 43C436BA368904AD002D11C5 /* LaunchScreen.storyboard */,
43C436BD268904AD002D11C5 /* Info.plist */, 43C436BD368904AD002D11C5 /* Info.plist */,
); );
path = "veilidtools-tests"; path = "veilidtools-tests";
sourceTree = "<group>"; sourceTree = "<group>";
@ -85,14 +85,14 @@
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
43C436AB268904AC002D11C5 /* veilidtools-tests */ = { 43C436AB368904AC002D11C5 /* veilidtools-tests */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 43C436C0268904AD002D11C5 /* Build configuration list for PBXNativeTarget "veilidtools-tests" */; buildConfigurationList = 43C436C0368904AD002D11C5 /* Build configuration list for PBXNativeTarget "veilidtools-tests" */;
buildPhases = ( buildPhases = (
43C436C326893020002D11C5 /* Cargo Build */, 43C436C336893020002D11C5 /* Cargo Build */,
43C436A8268904AC002D11C5 /* Sources */, 43C436A8368904AC002D11C5 /* Sources */,
43C436A9268904AC002D11C5 /* Frameworks */, 43C436A9368904AC002D11C5 /* Frameworks */,
43C436AA268904AC002D11C5 /* Resources */, 43C436AA368904AC002D11C5 /* Resources */,
); );
buildRules = ( buildRules = (
); );
@ -100,25 +100,25 @@
); );
name = "veilidtools-tests"; name = "veilidtools-tests";
productName = "veilidtools-tests"; productName = "veilidtools-tests";
productReference = 43C436AC268904AC002D11C5 /* veilidtools-tests.app */; productReference = 43C436AC368904AC002D11C5 /* veilidtools-tests.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
/* Begin PBXProject section */ /* Begin PBXProject section */
43C436A4268904AC002D11C5 /* Project object */ = { 43C436A4368904AC002D11C5 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 1250; LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1250; LastUpgradeCheck = 1250;
TargetAttributes = { TargetAttributes = {
43C436AB268904AC002D11C5 = { 43C436AB368904AC002D11C5 = {
CreatedOnToolsVersion = 12.5.1; CreatedOnToolsVersion = 12.5.1;
LastSwiftMigration = 1250; LastSwiftMigration = 1250;
}; };
}; };
}; };
buildConfigurationList = 43C436A7268904AC002D11C5 /* Build configuration list for PBXProject "veilidtools-tests" */; buildConfigurationList = 43C436A7368904AC002D11C5 /* Build configuration list for PBXProject "veilidtools-tests" */;
compatibilityVersion = "Xcode 9.3"; compatibilityVersion = "Xcode 9.3";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
@ -126,31 +126,31 @@
en, en,
Base, Base,
); );
mainGroup = 43C436A3268904AC002D11C5; mainGroup = 43C436A3368904AC002D11C5;
productRefGroup = 43C436AD268904AC002D11C5 /* Products */; productRefGroup = 43C436AD368904AC002D11C5 /* Products */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
43C436AB268904AC002D11C5 /* veilidtools-tests */, 43C436AB368904AC002D11C5 /* veilidtools-tests */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */ /* Begin PBXResourcesBuildPhase section */
43C436AA268904AC002D11C5 /* Resources */ = { 43C436AA368904AC002D11C5 /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
43C436BC268904AD002D11C5 /* LaunchScreen.storyboard in Resources */, 43C436BC368904AD002D11C5 /* LaunchScreen.storyboard in Resources */,
43C436B9268904AD002D11C5 /* Assets.xcassets in Resources */, 43C436B9368904AD002D11C5 /* Assets.xcassets in Resources */,
43C436B7268904AC002D11C5 /* Main.storyboard in Resources */, 43C436B7368904AC002D11C5 /* Main.storyboard in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
43C436C326893020002D11C5 /* Cargo Build */ = { 43C436C336893020002D11C5 /* Cargo Build */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1; alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -167,37 +167,37 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "../../../../ios_build.sh --features ios_tests\n"; shellScript = "../../../../ios_build.sh veilid_tools --features ios_tests,rt-tokio\n";
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
43C436A8268904AC002D11C5 /* Sources */ = { 43C436A8368904AC002D11C5 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
43C436B4268904AC002D11C5 /* ViewController.swift in Sources */, 43C436B4368904AC002D11C5 /* ViewController.swift in Sources */,
43C436B0268904AC002D11C5 /* AppDelegate.swift in Sources */, 43C436B0368904AC002D11C5 /* AppDelegate.swift in Sources */,
43C436B2268904AC002D11C5 /* SceneDelegate.swift in Sources */, 43C436B2368904AC002D11C5 /* SceneDelegate.swift in Sources */,
4317C6BD2694A676009C717F /* veilid-tools.c in Sources */, 4317C6BD3694A676009C717F /* (null) in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
43C436B5268904AC002D11C5 /* Main.storyboard */ = { 43C436B5368904AC002D11C5 /* Main.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
43C436B6268904AC002D11C5 /* Base */, 43C436B6368904AC002D11C5 /* Base */,
); );
name = Main.storyboard; name = Main.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
43C436BA268904AD002D11C5 /* LaunchScreen.storyboard */ = { 43C436BA368904AD002D11C5 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
43C436BB268904AD002D11C5 /* Base */, 43C436BB368904AD002D11C5 /* Base */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
@ -205,11 +205,11 @@
/* End PBXVariantGroup section */ /* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
43C436BE268904AD002D11C5 /* Debug */ = { 43C436BE368904AD002D11C5 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64; ARCHS = "$(ARCHS_STANDARD)";
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -264,14 +264,15 @@
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
}; };
43C436BF268904AD002D11C5 /* Release */ = { 43C436BF368904AD002D11C5 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64; ARCHS = "$(ARCHS_STANDARD)";
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -319,16 +320,18 @@
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule; SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
name = Release; name = Release;
}; };
43C436C1268904AD002D11C5 /* Debug */ = { 43C436C1368904AD002D11C5 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = ZJPQSFX5MW; DEVELOPMENT_TEAM = ZJPQSFX5MW;
INFOPLIST_FILE = "veilidtools-tests/Info.plist"; INFOPLIST_FILE = "veilidtools-tests/Info.plist";
@ -338,16 +341,13 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-L../../../../../target/aarch64-apple-ios/debug",
"-lveilid_tools",
);
"OTHER_LDFLAGS[sdk=iphonesimulator*]" = ( "OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
"-L../../../../../target/x86_64-apple-ios/debug", "-L../../../../../target/lipo-ios-sim/debug",
"-lveilid_tools", "-lveilid_tools",
); );
PRODUCT_BUNDLE_IDENTIFIER = "com.veilid.veilidtools-tests"; PRODUCT_BUNDLE_IDENTIFIER = "com.veilid.veilidtools-tests";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "veilidtools-tests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "veilidtools-tests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -355,12 +355,13 @@
}; };
name = Debug; name = Debug;
}; };
43C436C2268904AD002D11C5 /* Release */ = { 43C436C2368904AD002D11C5 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = ZJPQSFX5MW; DEVELOPMENT_TEAM = ZJPQSFX5MW;
INFOPLIST_FILE = "veilidtools-tests/Info.plist"; INFOPLIST_FILE = "veilidtools-tests/Info.plist";
@ -370,16 +371,13 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-L../../../../../target/aarch64-apple-ios/release",
"-lveilid_tools",
);
"OTHER_LDFLAGS[sdk=iphonesimulator*]" = ( "OTHER_LDFLAGS[sdk=iphonesimulator*]" = (
"-L../../../../../target/x86_64-apple-ios/release", "-L../../../../../target/lipo-ios-sim/release",
"-lveilid_tools", "-lveilid_tools",
); );
PRODUCT_BUNDLE_IDENTIFIER = "com.veilid.veilidtools-tests"; PRODUCT_BUNDLE_IDENTIFIER = "com.veilid.veilidtools-tests";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "veilidtools-tests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "veilidtools-tests-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -389,25 +387,25 @@
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
43C436A7268904AC002D11C5 /* Build configuration list for PBXProject "veilidtools-tests" */ = { 43C436A7368904AC002D11C5 /* Build configuration list for PBXProject "veilidtools-tests" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
43C436BE268904AD002D11C5 /* Debug */, 43C436BE368904AD002D11C5 /* Debug */,
43C436BF268904AD002D11C5 /* Release */, 43C436BF368904AD002D11C5 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
43C436C0268904AD002D11C5 /* Build configuration list for PBXNativeTarget "veilidtools-tests" */ = { 43C436C0368904AD002D11C5 /* Build configuration list for PBXNativeTarget "veilidtools-tests" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
43C436C1268904AD002D11C5 /* Debug */, 43C436C1368904AD002D11C5 /* Debug */,
43C436C2268904AD002D11C5 /* Release */, 43C436C2368904AD002D11C5 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };
rootObject = 43C436A4268904AC002D11C5 /* Project object */; rootObject = 43C436A4368904AC002D11C5 /* Project object */;
} }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1250" LastUpgradeVersion = "1410"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@ -14,7 +14,7 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "43C436AB268904AC002D11C5" BlueprintIdentifier = "43C436AB368904AC002D11C5"
BuildableName = "veilidtools-tests.app" BuildableName = "veilidtools-tests.app"
BlueprintName = "veilidtools-tests" BlueprintName = "veilidtools-tests"
ReferencedContainer = "container:veilidtools-tests.xcodeproj"> ReferencedContainer = "container:veilidtools-tests.xcodeproj">
@ -44,7 +44,7 @@
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "43C436AB268904AC002D11C5" BlueprintIdentifier = "43C436AB368904AC002D11C5"
BuildableName = "veilidtools-tests.app" BuildableName = "veilidtools-tests.app"
BlueprintName = "veilidtools-tests" BlueprintName = "veilidtools-tests"
ReferencedContainer = "container:veilidtools-tests.xcodeproj"> ReferencedContainer = "container:veilidtools-tests.xcodeproj">
@ -61,7 +61,7 @@
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "43C436AB268904AC002D11C5" BlueprintIdentifier = "43C436AB368904AC002D11C5"
BuildableName = "veilidtools-tests.app" BuildableName = "veilidtools-tests.app"
BlueprintName = "veilidtools-tests" BlueprintName = "veilidtools-tests"
ReferencedContainer = "container:veilidtools-tests.xcodeproj"> ReferencedContainer = "container:veilidtools-tests.xcodeproj">

View file

@ -6,12 +6,14 @@
// //
import UIKit import UIKit
import Darwin
class ViewController: UIViewController { class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
run_veilid_tools_tests() run_veilid_tools_tests()
exit(0)
} }

View file

@ -1,3 +1,11 @@
#[cfg(target_os = "android")]
mod android;
pub mod common; pub mod common;
#[cfg(target_os = "ios")]
mod ios;
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
mod native; mod native;
use super::*;
pub use common::*;

View file

@ -3,8 +3,7 @@
mod test_async_peek_stream; mod test_async_peek_stream;
use crate::tests::common::*; use super::*;
use crate::*;
#[cfg(all(target_os = "android", feature = "android_tests"))] #[cfg(all(target_os = "android", feature = "android_tests"))]
use jni::{objects::JClass, objects::JObject, JNIEnv}; use jni::{objects::JClass, objects::JObject, JNIEnv};
@ -17,30 +16,15 @@ pub extern "system" fn Java_com_veilid_veilidtools_veilidtools_1android_1tests_M
_class: JClass, _class: JClass,
ctx: JObject, ctx: JObject,
) { ) {
crate::intf::utils::android::veilid_tools_setup_android( crate::tests::android::veilid_tools_setup(env, ctx, "veilid-tools");
env,
ctx,
"veilid_tools",
crate::veilid_config::VeilidConfigLogLevel::Trace,
);
run_all_tests(); run_all_tests();
} }
#[cfg(all(target_os = "ios", feature = "ios_tests"))] #[cfg(all(target_os = "ios", feature = "ios_tests"))]
#[no_mangle] #[no_mangle]
#[allow(dead_code)]
pub extern "C" fn run_veilid_tools_tests() { pub extern "C" fn run_veilid_tools_tests() {
let log_path: std::path::PathBuf = [ crate::tests::ios::veilid_tools_setup().expect("setup failed");
std::env::var("HOME").unwrap().as_str(),
"Documents",
"veilid-tools.log",
]
.iter()
.collect();
crate::intf::utils::ios_test_setup::veilid_tools_setup(
"veilid-tools",
Some(Level::Trace),
Some((Level::Trace, log_path.as_path())),
);
run_all_tests(); run_all_tests();
} }
@ -88,43 +72,37 @@ fn exec_test_async_tag_lock() {
cfg_if! { cfg_if! {
if #[cfg(test)] { if #[cfg(test)] {
static DEFAULT_LOG_IGNORE_LIST: [&str; 21] = [
"mio",
"h2",
"hyper",
"tower",
"tonic",
"tokio",
"runtime",
"tokio_util",
"want",
"serial_test",
"async_std",
"async_io",
"polling",
"rustls",
"async_tungstenite",
"tungstenite",
"netlink_proto",
"netlink_sys",
"trust_dns_resolver",
"trust_dns_proto",
"attohttpc",
];
use serial_test::serial; use serial_test::serial;
use simplelog::*;
use std::sync::Once; use std::sync::Once;
static SETUP_ONCE: Once = Once::new(); static SETUP_ONCE: Once = Once::new();
pub fn setup() { pub fn setup() {
SETUP_ONCE.call_once(|| { SETUP_ONCE.call_once(|| {
let mut cb = ConfigBuilder::new();
for ig in DEFAULT_LOG_IGNORE_LIST { cfg_if! {
cb.add_filter_ignore_str(ig); 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();
} else {
use simplelog::*;
let mut cb = ConfigBuilder::new();
for ig in DEFAULT_LOG_IGNORE_LIST {
cb.add_filter_ignore_str(ig);
}
TestLogger::init(LevelFilter::Trace, cb.build()).unwrap();
}
} }
TestLogger::init(LevelFilter::Trace, cb.build()).unwrap();
}); });
} }

View file

@ -1,7 +1,7 @@
//! Test suite for the Web and headless browsers. //! Test suite for the Web and headless browsers.
#![cfg(target_arch = "wasm32")] #![cfg(target_arch = "wasm32")]
use veilid_tools::tests::common::*; use veilid_tools::tests::*;
use veilid_tools::*; use veilid_tools::*;
use wasm_bindgen_test::*; use wasm_bindgen_test::*;