Suppressing verbose console output - SwiftUI / MacOS Monterey - swiftui

Is there anyway to suppress the very verbose console output I am getting with MacOS Monterey and SwiftUI code? Here's a snippet of the output:
2021-07-20 09:58:18.267602+0100 BBCFTEST[19341:1880374] IMKInputSession (deactivate) CFRunLoopObserver kCFRunLoopExit (State change BEGIN) - innerRunLoopCount=1, otherInnerRunLoopDetected=0
2021-07-20 09:58:18.267637+0100 BBCFTEST[19341:1880374] IMKInputSession (deactivate) CFRunLoopObserver kCFRunLoopExit (State change END) - innerRunLoopCount=0, otherInnerRunLoopDetected=0
2021-07-20 09:58:18.270063+0100 BBCFTEST[19341:1880374] IMKInputSession (deactivate) CFRunLoopRunInMode exited, (kCFRunLoopRunStopped)
2021-07-20 09:58:18.270109+0100 BBCFTEST[19341:1880374] IMKInputSession (deactivate) CFRunLoopRunInMode (kIMKXPCPrivateRunLoopMode) ] RunLoopFinished(1)/Stopped(2) - Run result = 2, (Invocation already done = 1) (Sentinel IsZombie = 0)
2021-07-20 09:58:18.270147+0100 BBCFTEST[19341:1880374] IMKInputSession (deactivate) CFRunLoopRunInMode() LOOP DONE!

Related

If statement not going to else statement in Katalon Studio for Android

I am using Katalon for Android Testing. I want it to click ImageView3 if it is present. If not, it will click ImageView2 (which makes ImageView3 appear later).
I have tried verifyElementVisible and verifyElementNotVisible. Also tried adding the if statement as 'if (Mobile.verifyElementVisible(findTestObject('Objects/android.widget.ImageView3'), 0) == true)' but this produced the same error.
Mobile.tap(findTestObject('Objects/android.widget.ImageView1'), 0)
if (Mobile.verifyElementVisible(findTestObject('Objects/android.widget.ImageView3'), 0))
{
Mobile.verifyElementVisible(findTestObject('Objects/android.widget.ImageView3'), 0)
Mobile.tap(findTestObject('Objects/android.widget.ImageView3'), 0)
Mobile.closeApplication()
} else
{
Mobile.tap(findTestObject('Objects/android.widget.ImageView2'), 30)
Mobile.verifyElementVisible(findTestObject('Objects/android.widget.ImageView3'), 0)
Mobile.tap(findTestObject('Objects/android.widget.ImageView3'), 0)
Mobile.closeApplication()
}
The error in the log is showing the following:
Reason: com.kms.katalon.core.exception.StepFailedException: Element 'Object Repository/Objects/android.widget.ImageView3' not found at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:48)
As ImageView3 was not found, I would expect it to jump to the else statement. Any suggestion why this is not happening?
The FailureHandling was not set. It would throw an error as this was not set.
Added FailureHandling.OPTIONAL to the if statement
if (Mobile.verifyElementVisible(findTestObject('Objects/android.widget.ImageView3'), 0, FailureHandling.OPTIONAL))

Xamarin.Forms OpenGLView does not work when used inside a XAML page

I tried to use the simple example provided here:
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.openglview?view=xamarin-forms
to try to create a XAML View with the OpenGLView Class. But I'm running into issues. This is Xamarin.Forms (l, ran on iOS Simulator and using the Prism framework, macOS Mojave and Visual Studio for Mac 2019 Pro.
Here is my XAML Code:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
xmlns:otk="clr-namespace:OpenTK.Graphics.ES3"
x:Class="MyApp.Views.OpenGlPage">
<StackLayout HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand">
<OpenGLView x:Name="openGLView" HasRenderLoop="true"/>
<Button Command="{Binding Display}" Text="Display"/>
</StackLayout>
</ContentPage>
and the code behind
using Xamarin.Forms;
using OpenTK.Graphics.ES30;
namespace MyApp.Views
{
public partial class OpenGlPage : ContentPage
{
float red, green, blue;
public OpenGlPage()
{
InitializeComponent();
Title = "OpenGL";
openGLView.HeightRequest = 300;
openGLView.WidthRequest = 300;
openGLView.OnDisplay = r => {
GL.ClearColor(red, green, blue, 1.0f);
GL.Clear((ClearBufferMask.ColorBufferBit |
ClearBufferMask.DepthBufferBit));
red += 0.01f;
if (red >= 1.0f)
red -= 1.0f;
green += 0.02f;
if (green >= 1.0f)
green -= 1.0f;
blue += 0.03f;
if (blue >= 1.0f)
blue -= 1.0f;
};
}
}
}
The ViewModel does not have much, and the View is properly registered with Prism so the navigating to this view works fine.
But it looks like there is some issue with the way that OpenGL is used or initialized when dropped in XAML like this. When the execution hits any GL.* call application crashes. This is the error:
=================================================================
Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
=================================================================
Basic Fault Adddress Reporting
=================================================================
instruction pointer is NULL, skip dumping
=================================================================
Native stacktrace:
=================================================================
0x10184704d - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : mono_dump_native_crash_info
0x10183b7a5 - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : mono_handle_native_crash
0x10184db43 - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : mono_sigsegv_signal_handler
0x10f329b5d - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x18 - Unknown
0x135d884bf - Unknown
0x135d88927 - Unknown
0x101850fa1 - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : mono_jit_runtime_invoke
0x10196ab78 - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : mono_runtime_invoke_checked
0x10196e4ce - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : mono_runtime_invoke
0x101a8142a - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : xamarin_invoke_trampoline
0x101a89365 - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : xamarin_arch_trampoline
0x101a8a761 - /Users/user/Library/Developer/CoreSimulator/Devices/602074EE-E100-4319-B9DE-D9460B6264EB/data/Containers/Bundle/Application/7937567A-2C4D-43A6-8A81-B27BFEF73EF6/Prism1.iOS.app/Prism1.iOS : xamarin_x86_64_common_trampoline
0x1077a8ffd - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/GLKit.framework/GLKit : -[GLKView _display:]
0x112231c21 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/QuartzCore.framework/QuartzCore : -[CALayer display]
0x112244003 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/QuartzCore.framework/QuartzCore : _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE
0x1121b33aa - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/QuartzCore.framework/QuartzCore : _ZN2CA7Context18commit_transactionEPNS_11TransactionE
0x1121ea584 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/QuartzCore.framework/QuartzCore : _ZN2CA11Transaction6commitEv
0x117924d8a - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIApplicationFlushRunLoopCATransactionIfTooLate
0x117a17f5f - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : __handleEventQueueInternal
0x10242ebe1 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
0x10242e463 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopDoSources0
0x102428b1f - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopRun
0x102428302 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
0x11249f2fe - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
0x11792aba2 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
0x134910932 - Unknown
0x1349106c3 - Unknown
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at UIKit.UIApplication:UIApplicationMain <0x00211>
at UIKit.UIApplication:Main <0x000b2>
at UIKit.UIApplication:Main <0x00222>
at Prism1.iOS.Application:Main <0x00092>
at <Module>:runtime_invoke_void_object <0x00168>
=================================================================
This happens regardless what GL call I have there in the OnDisplay handler. If I remove the GL calls everything works fine of course, minus the OpenGL content :)
Compilation warnings:

QML test fails in Qt 5.9.1

While compiling in Qt 5.9.1 version it is not working.. Any one help me to compile this TestCase in qml..
import QtQuick 2.0
import QtTest 1.1
TestCase{
function test_math() {
compare(2 + 2, 4, "2 + 2 = 4")
}
function test_fail() {
compare(2 + 2, 5, "2 + 2 = 5")
}
}
Getting error like this:
Type TestCase unavailable and module Qt.test.qtestroot is not installed

iOS Unit testing - bad access error when using NSRunLoop and AFNetworking at the same time

I'm using the code below to test asynchronous calls using AFNetworking in my unit tests for iOS7. When I run the test alone, or even the entire test case, the code works fine. However, when I run the entire test suite, I get EXC_BAD_ACCESS (code=1, address0x7a) on the line [theRL runMode:NSDefaultRunLoopMode beforeDate:date];
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
//setup timeout
float waitIncrement = 0.1f;
int timeoutCounter = (int)(60 / waitIncrement); //30 sec timeout
BOOL controlConditionReached = NO;
// Begin a run loop terminated when the downloadComplete it set to true
while (controlConditionReached == NO)
{
NSDate* date = [NSDate dateWithTimeIntervalSinceNow:waitIncrement];
//Here: EXC_BAD_ACCESS (code=1, address0x7a) when running the entire test suite
[theRL runMode:NSDefaultRunLoopMode beforeDate:date];
//control condition is set in one of your async operation delegate methods or blocks
controlConditionReached = self.downloadComplete || self.downloadFailed||self.cachedVideoAvailable ;
//if there's no response - timeout after some time
if(--timeoutCounter <= 0)
{
break;
}
}
I see that at the same time as I'm using my loop, AFNetoworking is using this method:
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
#autoreleasepool {
[[NSThread currentThread] setName:#"AFNetworking"];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
}
}
How can I identify what is causing this error? If I change my method's run loop mode to NSRunLoopCommonModes, then all of my tests fail

Post-build step in QBS

I'm trying to convert the nRF51822 (an Arm Cortex microcontroller) build process from Make to QBS. I've got the compilation process working ok (lots of hard-coded paths but I'll fix that later). However, the final step is to use objcopy to convert the .out file produced by the linker to a .hex file. I can't work out how to get my rule to run other than by making another Application like this (which doesn't work very well):
import qbs
import qbs.FileInfo
Project {
CppApplication {
type: "application" // To suppress bundle generation on Mac
name: "nrf51_template"
files: ["main.cpp",
"nrf51822/Source/nrf_delay/nrf_delay.c"]
Group {
name: "Startup files"
files: ["nrf51822/Source/Templates/system_" + deviceSeries + ".c",
"nrf51822/Source/Templates/gcc/gcc_startup_" + deviceSeries + ".s"]
}
// The chip variant can be:
//
// "xxaa": The 256 kB version
// "xxbb": The 128 kB version
//
// RFduino is xxaa.
property string deviceVariant: "xxaa"
// Must be "nrf51"
property string deviceSeries: "nrf51"
// The softdevice (radio firmware) to use. Can be:
//
// "": For no radio.
// "s110": For BLE slave/peripheral
// "s120": For BLE host/central
// "s130": For BLE central and peripheral
property string softDevice: "s110"
// Must be cortex-m0
property string cpu: "cortex-m0"
cpp.includePaths: ["nrf51822/Include", "nrf51822/Include/gcc"]
cpp.compilerName: ["arm-none-eabi-g++.exe"]
cpp.compilerPath: ["C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/bin/arm-none-eabi-g++.exe"]
cpp.linkerName: ["arm-none-eabi-g++.exe"]
cpp.linkerPath: ["C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/bin/arm-none-eabi-g++.exe"]
cpp.cxxFlags: ["-mcpu=" + cpu, "-mthumb", "-mabi=aapcs", "--std=c++11", "-mfloat-abi=soft"]
cpp.linkerFlags: ["-L\"C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/arm-none-eabi/lib/armv6-m\"",
"-L\"C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/lib/gcc/arm-none-eabi/4.8.3/armv6-m\"",
"-Xlinker",
"-Map=C:/Users/thutt/nRF51_Template/output_filename.map",
"-mcpu=" + cpu,
"-mthumb",
"-mabi=aapcs",
"-L", "C:/Users/thutt/nRF51_Template/nrf51822/Source/templates/gcc/",
"-Tgcc_" + deviceSeries + "_" + softDevice + "_" + deviceVariant + ".ld"]
cpp.defines: ["BOARD_PCA10001", "NRF51"]
// Suppresses -m32 compiler option.
cpp.architecture: "arm"
// Suppress windows definitions and compiler options.
cpp.minimumWindowsVersion: undefined
cpp.executableSuffix: ".out"
// To flash:
// nrfjprog --reset --program $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
}
Application {
name: "nrf51_template_hex"
Group {
files: "C:/Users/thutt/nRF51_Template-build/qtc_Desktop2-debug/nrf51_template.out"
fileTags: ["out"]
}
Depends {
name: "nrf51_template"
}
Rule {
id: hex
inputs: ["out"]
Artifact {
fileTags: ["application"]
fileName: ".obj/" + product.name + "/" + input.baseDir + "/" + input.fileName + ".hex"
}
prepare: {
// var compilerPath = ModUtils.moduleProperty(product, "compilerPath");
var objCopyPath = "C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/bin/arm-none-eabi-objcopy.exe";
var args = ["-O", "ihex", input.filePath, output.filePath];
var cmd = new Command(objCopyPath, args);
cmd.description = "converting to hex: " + FileInfo.fileName(input.filePath);
cmd.highlight = "linker";
return cmd;
}
}
}
}
Is it possible to have a post-link step in the CppApplication instead of two Applications like this? Am I better off defining a totally new Application with my own Rules for compilation and linking?
Also bonus question, is it possible to specify the "run" executable in the QBS file so that when I click run in QtCreator it actually runs nrfjprog.exe and flashes the code to the chip? (You can do this in the IDE but I'd prefer to be able to do it in the QBS file.)
Figured it out, the final targets are determined by the type: line in the Application so just change it to this:
import qbs
import qbs.FileInfo
Project {
CppApplication {
// The filetag to generate.
type: "hex"
name: "nrf51_template"
files: ["main.cpp",
"SaneSPI.cpp",
"SaneSPI.h",
"Timer.cpp",
"Timer.h",
"Delay.cpp",
"Delay.h",
"GPIO.cpp",
"GPIO.h"]
Group {
name: "Startup files"
files: ["nrf51822/Source/Templates/system_" + deviceSeries + ".c",
"nrf51822/Source/Templates/gcc/gcc_startup_" + deviceSeries + ".s"]
}
// The chip variant can be:
//
// "xxaa": The 256 kB version
// "xxbb": The 128 kB version
//
// RFduino is xxaa.
property string deviceVariant: "xxaa"
// Must be "nrf51"
property string deviceSeries: "nrf51"
// The softdevice (radio firmware) to use. Can be:
//
// "": For no radio.
// "s110": For BLE slave/peripheral
// "s120": For BLE host/central
// "s130": For BLE central and peripheral
property string softDevice: "s110"
// Must be cortex-m0
property string cpu: "cortex-m0"
cpp.includePaths: ["nrf51822/Include",
"nrf51822/Include/gcc",
"nrf51822/Include/" + softDevice]
cpp.compilerName: ["arm-none-eabi-g++.exe"]
cpp.compilerPath: ["C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/bin/arm-none-eabi-g++.exe"]
cpp.linkerName: ["arm-none-eabi-g++.exe"]
cpp.linkerPath: ["C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/bin/arm-none-eabi-g++.exe"]
cpp.cxxFlags: ["-mcpu=" + cpu, "-mthumb", "-mabi=aapcs", "--std=c++11", "-mfloat-abi=soft"]
cpp.linkerFlags: ["-L\"C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/arm-none-eabi/lib/armv6-m\"",
"-L\"C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/lib/gcc/arm-none-eabi/4.8.3/armv6-m\"",
"-Xlinker",
"-Map=C:/Users/thutt/nRF51_Template/output_filename.map",
"-mcpu=" + cpu,
"-mthumb",
"-mabi=aapcs",
"-L", "C:/Users/thutt/nRF51_Template/nrf51822/Source/templates/gcc/",
"-Tgcc_" + deviceSeries + "_" + softDevice + "_" + deviceVariant + ".ld"]
cpp.defines: ["BOARD_PCA10001", "NRF51"]
// Suppresses -m32 compiler option.
cpp.architecture: "arm"
// Suppress windows definitions and compiler options.
cpp.minimumWindowsVersion: undefined
cpp.executableSuffix: ".out"
Rule {
id: hex
inputs: ["application"]
Artifact {
fileTags: ["hex"]
fileName: ".obj/" + product.name + "/" + input.baseDir + "/" + input.fileName + ".hex"
}
prepare: {
// var compilerPath = ModUtils.moduleProperty(product, "compilerPath");
var objCopyPath = "C:/Program Files/GNU Tools ARM Embedded/4.8 2014q1/bin/arm-none-eabi-objcopy.exe";
var args = ["-O", "ihex", input.filePath, output.filePath];
var cmd = new Command(objCopyPath, args);
cmd.description = "converting to hex: " + FileInfo.fileName(input.filePath);
cmd.highlight = "linker";
return cmd;
}
}
// To flash:
// nrfjprog --reset --program $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
}
}