feat(windows): sentry integration test points

This commit is contained in:
Marc Durdin 2020-03-31 16:16:56 +11:00
parent 8b3707571c
commit fed63d4690
27 changed files with 818 additions and 50 deletions

View file

@ -157,7 +157,8 @@ uses
Sentry.Client in '..\..\ext\sentry\Sentry.Client.pas',
Sentry.Client.Vcl in '..\..\ext\sentry\Sentry.Client.Vcl.pas',
sentry in '..\..\ext\sentry\sentry.pas',
Keyman.System.KeymanSentryClient in '..\..\global\delphi\general\Keyman.System.KeymanSentryClient.pas';
Keyman.System.KeymanSentryClient in '..\..\global\delphi\general\Keyman.System.KeymanSentryClient.pas',
Keyman.Configuration.UI.UfrmDiagnosticTests in 'util\Keyman.Configuration.UI.UfrmDiagnosticTests.pas' {frmDiagnosticTests};
{$R VERSION.RES}
{$R manifest.res}

View file

@ -302,6 +302,10 @@
<DCCReference Include="..\..\ext\sentry\Sentry.Client.Vcl.pas"/>
<DCCReference Include="..\..\ext\sentry\sentry.pas"/>
<DCCReference Include="..\..\global\delphi\general\Keyman.System.KeymanSentryClient.pas"/>
<DCCReference Include="util\Keyman.Configuration.UI.UfrmDiagnosticTests.pas">
<Form>frmDiagnosticTests</Form>
<FormType>dfm</FormType>
</DCCReference>
<None Include="Profiling\AQtimeModule1.aqt"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
@ -394,18 +398,18 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="kmshell.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>kmshell.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Profiling\AQtimeModule1.aqt" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="kmshell.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>kmshell.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View file

@ -168,6 +168,7 @@ uses
KeyboardListXMLRenderer,
Imm,
initprog,
Keyman.Configuration.UI.UfrmDiagnosticTests,
KeymanOptionNames,
KeyNames,
LanguagesXMLRenderer,
@ -805,7 +806,10 @@ end;
procedure TfrmMain.Support_Diagnostics;
begin
kmcom.Control.OpenDiagnostics;
// Show the internal debug diagnostic tests form if Ctrl+Shift is down
if(GetKeyState(VK_CONTROL) < 0) and (GetKeyState(VK_SHIFT) < 0)
then TfrmDiagnosticTests.Run
else kmcom.Control.OpenDiagnostics;
end;
procedure TfrmMain.Support_Online;

View file

@ -0,0 +1,72 @@
object frmDiagnosticTests: TfrmDiagnosticTests
Left = 0
Top = 0
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Diagnostic Tests'
ClientHeight = 166
ClientWidth = 362
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object cmdSendTestException: TButton
Left = 8
Top = 8
Width = 185
Height = 25
Caption = '&Send Test Exception'
TabOrder = 0
OnClick = cmdSendTestExceptionClick
end
object cmdSendTestCOMAPIException: TButton
Left = 8
Top = 70
Width = 185
Height = 25
Caption = 'Send Test COM &API Exception'
TabOrder = 1
end
object cmdClose: TButton
Left = 279
Top = 133
Width = 75
Height = 25
Cancel = True
Caption = '&Close'
ModalResult = 1
TabOrder = 2
end
object cmdSendTestEvent: TButton
Left = 8
Top = 39
Width = 185
Height = 25
Caption = '&Send Test Event'
TabOrder = 3
OnClick = cmdSendTestEventClick
end
object cmdSendTestKeyman32Exception: TButton
Left = 8
Top = 101
Width = 185
Height = 25
Caption = 'Send Test &keyman32 Exception'
TabOrder = 4
OnClick = cmdSendTestKeyman32ExceptionClick
end
object cmdSendTestKMTipException: TButton
Left = 8
Top = 132
Width = 185
Height = 25
Caption = 'Send Test km&tip Exception'
TabOrder = 5
OnClick = cmdSendTestKMTipExceptionClick
end
end

View file

@ -0,0 +1,99 @@
unit Keyman.Configuration.UI.UfrmDiagnosticTests;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TfrmDiagnosticTests = class(TForm)
cmdSendTestException: TButton;
cmdSendTestCOMAPIException: TButton;
cmdClose: TButton;
cmdSendTestEvent: TButton;
cmdSendTestKeyman32Exception: TButton;
cmdSendTestKMTipException: TButton;
procedure cmdSendTestExceptionClick(Sender: TObject);
procedure cmdSendTestEventClick(Sender: TObject);
procedure cmdSendTestCOMAPIEventClick(Sender: TObject);
procedure cmdSendTestKMTipExceptionClick(Sender: TObject);
procedure cmdSendTestKeyman32ExceptionClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
class procedure Run;
end;
implementation
uses
Sentry.Client,
Keyman.System.KeymanSentryClient,
KeymanEngineControl,
kmint;
{$R *.dfm}
procedure TfrmDiagnosticTests.cmdSendTestCOMAPIEventClick(Sender: TObject);
begin
(kmcom.Control as IKeymanEngineControl).DiagnosticTestException;
end;
procedure TfrmDiagnosticTests.cmdSendTestEventClick(Sender: TObject);
begin
TKeymanSentryClient.Client.MessageEvent(Sentry.Client.SENTRY_LEVEL_INFO, 'Triggered '+TKeymanSentryClient.LOGGER_DESKTOP+'.kmshell');
end;
procedure TfrmDiagnosticTests.cmdSendTestExceptionClick(Sender: TObject);
begin
TKeymanSentryClient.Validate(True);
end;
type
TKeyman_Diagnostic = procedure(mode: Integer); stdcall;
procedure TfrmDiagnosticTests.cmdSendTestKeyman32ExceptionClick(
Sender: TObject);
var
h: THandle;
Keyman_Diagnostic: TKeyman_Diagnostic;
begin
h := GetModuleHandle('keyman32.dll');
if h <> 0 then
begin
Keyman_Diagnostic := GetProcAddress(h, 'Keyman_Diagnostic');
if Assigned(Keyman_Diagnostic) then
Keyman_Diagnostic(0);
end;
end;
procedure TfrmDiagnosticTests.cmdSendTestKMTipExceptionClick(Sender: TObject);
var
h: THandle;
Keyman_Diagnostic: TKeyman_Diagnostic;
begin
h := GetModuleHandle('kmtip.dll');
if h <> 0 then
begin
Keyman_Diagnostic := GetProcAddress(h, 'Keyman_Diagnostic');
if Assigned(Keyman_Diagnostic) then
Keyman_Diagnostic(0);
end;
end;
class procedure TfrmDiagnosticTests.Run;
var
f: TfrmDiagnosticTests;
begin
f := TfrmDiagnosticTests.Create(nil);
try
f.ShowModal;
finally
f.Free;
end;
end;
end.

View file

@ -12,15 +12,28 @@ Sentry.init({
release: 'release-$VersionWithTag'
});
/* // Test sentry here:
function foobar() {
fbb();
function keymanEnableDiagnostics() {
var e = document.createElement('button');
e.style.zIndex = '1000';
e.style.position = 'fixed';
e.style.right = '10px';
e.style.top = '10px';
e.style.height = '24px';
e.innerText = 'Test Exception';
e.onclick = function() {
var boo = null.boo();
}
document.body.appendChild(e);
e = document.createElement('button');
e.style.zIndex = '1000';
e.style.position = 'fixed';
e.style.right = '10px';
e.style.top = '38px';
e.style.height = '24px';
e.innerText = 'Test Event';
e.onclick = function() {
Sentry.captureMessage('Test Event');
}
document.body.appendChild(e);
}
function fbb() {
Sentry.captureException(new Error("Something broke again"));
}
foobar();
*/

View file

@ -3091,11 +3091,15 @@ inherited frmKeymanDeveloper: TfrmKeymanDeveloper
object Options1: TMenuItem
Action = modActionsMain.actToolsOptions
end
object DebugTests1: TMenuItem
object mnuToolsDebugTests: TMenuItem
Caption = 'Debug Tests'
object CrashTest1: TMenuItem
Caption = 'Crash Test'
OnClick = crash1Click
object mnuToolsDebugTestsExceptionTest: TMenuItem
Caption = '&Exception Test'
OnClick = mnuToolsDebugTestsExceptionTestClick
end
object mnuToolsDebugTestsCompilerExceptionTest: TMenuItem
Caption = '&Compiler Exception Test'
OnClick = mnuToolsDebugTestsCompilerExceptionTestClick
end
end
end

View file

@ -267,20 +267,21 @@ type
ReloadasANSI1: TMenuItem;
ReloadasUTF81: TMenuItem;
ReloadasUTF161: TMenuItem;
DebugTests1: TMenuItem;
CrashTest1: TMenuItem;
mnuToolsDebugTests: TMenuItem;
mnuToolsDebugTestsExceptionTest: TMenuItem;
CloseProject1: TMenuItem;
mnuModel: TMenuItem;
CompileModel1: TMenuItem;
N2: TMenuItem;
estLexicalModel1: TMenuItem;
mnuToolsDebugTestsCompilerExceptionTest: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure mnuFileClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure mnuProjectClick(Sender: TObject);
procedure crash1Click(Sender: TObject);
procedure mnuToolsDebugTestsExceptionTestClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure cbTextFileFormatItemClick(Sender: TObject);
procedure cbDebugSystemKeyboard_DropDown(Sender: TObject);
@ -292,6 +293,7 @@ type
procedure pagesChange(Sender: TObject);
procedure pagesCloseTab(Sender: TObject; Index: Integer);
procedure ools1Click(Sender: TObject);
procedure mnuToolsDebugTestsCompilerExceptionTestClick(Sender: TObject);
private
AppStorage: TJvAppRegistryStorage;
@ -424,6 +426,7 @@ uses
Keyman.System.CEFManager,
CharMapDropTool,
compile,
HTMLHelpViewer,
KLog,
keymanapi_TLB,
@ -1365,8 +1368,7 @@ end;
procedure TfrmKeymanDeveloper.ools1Click(Sender: TObject);
begin
inherited;
DebugTests1.Visible := GetKeyState(VK_SHIFT) < 0;
mnuToolsDebugTests.Visible := (GetKeyState(VK_CONTROL) < 0) and (GetKeyState(VK_SHIFT) < 0);
end;
procedure TfrmKeymanDeveloper.mnuProjectClick(Sender: TObject);
@ -1403,7 +1405,13 @@ begin
modActionsMain.actToolsFileFormat.Execute;
end;
procedure TfrmKeymanDeveloper.crash1Click(Sender: TObject);
procedure TfrmKeymanDeveloper.mnuToolsDebugTestsCompilerExceptionTestClick(
Sender: TObject);
begin
Compiler_Diagnostic(0);
end;
procedure TfrmKeymanDeveloper.mnuToolsDebugTestsExceptionTestClick(Sender: TObject);
begin
TKeymanSentryClient.Validate(True);
end;

View file

@ -12,15 +12,28 @@ Sentry.init({
release: 'release-$VersionWithTag'
});
/* // Test sentry here:
function foobar() {
fbb();
function keymanEnableDiagnostics() {
var e = document.createElement('button');
e.style.zIndex = '1000';
e.style.position = 'fixed';
e.style.right = '10px';
e.style.top = '10px';
e.style.height = '24px';
e.innerText = 'Test Exception';
e.onclick = function() {
var boo = null.boo();
}
document.body.appendChild(e);
e = document.createElement('button');
e.style.zIndex = '1000';
e.style.position = 'fixed';
e.style.right = '10px';
e.style.top = '38px';
e.style.height = '24px';
e.innerText = 'Test Event';
e.onclick = function() {
Sentry.captureMessage('Test Event');
}
document.body.appendChild(e);
}
function fbb() {
Sentry.captureException(new Error("Something broke again"));
}
foobar();
*/

View file

@ -3497,3 +3497,9 @@ HANDLE UTF16TempFromUTF8(HANDLE hInfile, BOOL hasPreamble)
SetFilePointer(hOutfile, 2, NULL, FILE_BEGIN);
return hOutfile;
}
extern "C" void __declspec(dllexport) Keyman_Diagnostic(int mode) {
if (mode == 0) {
RaiseException(0xDEADBEEF, EXCEPTION_NONCONTINUABLE, 0, NULL);
}
}

View file

@ -7,7 +7,7 @@
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>18.4</ProjectVersion>
<ProjectVersion>18.8</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
@ -190,12 +190,16 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>0</Operation>
</Platform>
</DeployClass>
@ -204,6 +208,20 @@
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
@ -216,90 +234,242 @@
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
@ -317,6 +487,10 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -326,6 +500,10 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -348,6 +526,10 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -357,6 +539,9 @@
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
@ -369,6 +554,9 @@
<Platform Name="OSX32">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -384,6 +572,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1024x768">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
@ -395,6 +594,39 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536x2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1668">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1668x2388">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
@ -406,6 +638,61 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048x1536">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048x2732">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2224">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2388x1668">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2732x2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
@ -417,6 +704,116 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768x1024">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1125">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1136x640">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1242">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1242x2688">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1334">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1792">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2208">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2436">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2688x1242">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch320">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
@ -450,10 +847,35 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch750">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch828">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
@ -479,6 +901,7 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
@ -486,12 +909,20 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
@ -507,10 +938,19 @@
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
@ -546,7 +986,9 @@
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>

View file

@ -357,6 +357,8 @@ var
wm_keyman_globalswitch, wm_keyman_globalswitch_process, wm_keyman_control, wm_keyman_control_internal, wm_test_keyman_functioning: Cardinal;
FEnableCrashTest: Boolean = False;
const
KMC_StartProduct = 0;
KMC_StopProduct = 1;
@ -396,6 +398,7 @@ uses
UfrmOSKCharacterMap,
utilstr,
utilwow64,
Keyman.System.KeymanSentryClient,
KeymanEngineControl,
KeymanControlMessages,
KeymanDesktopShell,
@ -1543,6 +1546,10 @@ end;
procedure TfrmKeyman7Main.MnuOpenProductHelp(Sender: TObject);
begin
// Ctrl+Shift+Help command, with command line -sentry-client-test-exception
if FEnableCrashTest and (GetKeyState(VK_CONTROL) < 0) and (GetKeyState(VK_SHIFT) < 0) then
TKeymanSentryClient.Validate(True);
TKeymanDesktopShell.OpenHelpJump('context_traymenu', Self.ActiveKeyboard);
end;

View file

@ -160,6 +160,7 @@ var
sCommand: string;
begin
Result := False;
if LowerCase(ParamStr(1)) <> '-kmc' then Exit;
sCommand := LowerCase(ParamStr(2));
@ -174,6 +175,9 @@ begin
FCommand := KMC_HideVisualKeyboard
else Exit;
FEnableCrashTest := ParamStr(3) = '-sentry-client-test-exception';
Result := True;
end;

View file

@ -36,3 +36,5 @@ EXPORTS
Keyman_WriteDebugEvent
Keyman_UpdateTouchPanelVisibility
Keyman_Diagnostic

View file

@ -313,3 +313,9 @@ void _OutputThreadDebugString(char *s) {
OutputDebugString(buf);
}
#endif
void WINAPI Keyman_Diagnostic(int mode) {
if (mode == 0) {
RaiseException(0xDEADBEEF, EXCEPTION_NONCONTINUABLE, 0, NULL);
}
}

View file

@ -147,6 +147,8 @@ type
procedure EnableUserInterface; safecall;
procedure UpdateTouchPanelVisibility(Value: Boolean); safecall;
procedure DiagnosticTestException; safecall;
{ IIntKeymanControl }
procedure AutoApplyKeyman;
procedure ApplyKeyman;
@ -442,6 +444,11 @@ begin
Result := DefWindowProc(RefreshHandle, Msg, WParam, LParam);
end;
procedure TKeymanControl.DiagnosticTestException;
begin
raise Exception.Create('Testing safecall wrappering of exception for Sentry');
end;
procedure TKeymanControl.DisableUserInterface;
const
KM_DISABLEUI = 1;

View file

@ -115,3 +115,8 @@ void DebugLastError_1(char *file, int line, char *func, PWCHAR msg, DWORD err) {
}
}
void WINAPI Keyman_Diagnostic(int mode) {
if (mode == 0) {
RaiseException(0xDEADBEEF, EXCEPTION_NONCONTINUABLE, 0, NULL);
}
}

View file

@ -5,4 +5,5 @@ EXPORTS
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
RefreshPreservedKeys
RefreshPreservedKeys
Keyman_Diagnostic

View file

@ -203,6 +203,7 @@ object frmDiagnostics: TfrmDiagnostics
end
object mnuOptions: TMenuItem
Caption = '&Options'
OnClick = mnuOptionsClick
object mnuOptionsAdvancedView: TMenuItem
Caption = '&Advanced View'
OnClick = mnuOptionsAdvancedViewClick
@ -216,6 +217,13 @@ object frmDiagnostics: TfrmDiagnostics
Caption = 'Reload page'
ShortCut = 16466
end
object mnuOptionsDebugTests: TMenuItem
Caption = 'Debug Tests'
object mnuOptionsSentryExceptionTest: TMenuItem
Caption = 'Sentry Exception Test'
OnClick = mnuOptionsSentryExceptionTestClick
end
end
end
object mnuHelp: TMenuItem
Caption = '&Help'

View file

@ -64,6 +64,8 @@ type
Label3: TLabel;
mnuOptionsXMLView: TMenuItem;
Reloadpage1: TMenuItem;
mnuOptionsDebugTests: TMenuItem;
mnuOptionsSentryExceptionTest: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure mnuFileOpenClick(Sender: TObject);
@ -74,6 +76,8 @@ type
procedure mnuOptionsAdvancedViewClick(Sender: TObject);
procedure mnuHelpAboutClick(Sender: TObject);
procedure mnuOptionsXMLViewClick(Sender: TObject);
procedure mnuOptionsSentryExceptionTestClick(Sender: TObject);
procedure mnuOptionsClick(Sender: TObject);
private
FSIList: TSIList;
FGlobalXMLDocument: IXMLDOMDocument;
@ -104,12 +108,19 @@ procedure KeymanDiag;
implementation
uses
// keymanstrings,
KeymanPaths, ActiveX, ComObj,
ErrorControlledRegistry, RegistryKeys,
shlobj,
System.Win.ComObj,
Winapi.ActiveX,
Winapi.shlobj,
ErrorControlledRegistry,
Keyman.System.KeymanSentryClient,
KeymanPaths,
RegistryKeys,
sysinfo_Util,
UframeAttachedFiles,
VersionInfo, UfrmEmail, sysinfo_Util, utilexecute;
UfrmEmail,
utilexecute,
VersionInfo;
{$R *.dfm}
@ -125,6 +136,11 @@ begin
Application.Run;
end;
procedure TfrmDiagnostics.mnuOptionsSentryExceptionTestClick(Sender: TObject);
begin
TKeymanSentryClient.Validate(True);
end;
function TfrmDiagnostics.CollectDiagnostics: string;
begin
FSIList.Collect;
@ -436,6 +452,11 @@ begin
pages.Visible := mnuOptionsAdvancedView.Checked;
end;
procedure TfrmDiagnostics.mnuOptionsClick(Sender: TObject);
begin
mnuOptionsDebugTests.Visible := (GetKeyState(VK_CONTROL) < 0) and (GetKeyState(VK_SHIFT) < 0);
end;
procedure TfrmDiagnostics.mnuOptionsXMLViewClick(Sender: TObject); // I3766
var
i: Integer;

View file

@ -128,7 +128,6 @@
<VerInfo_Keys>CompanyName=;FileVersion=5.0.0.26;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<BT_BuildType>Debug</BT_BuildType>
<Debugger_RunParams>-c &quot;C652180A07DD4C0CB7811A63E26BC1F7&quot; &quot;Keyman Developer&quot; &quot;tike-14.0.29-alpha-local&quot; &quot;keyman-developer&quot; &quot;ESentryTest&quot; &quot;Exception ESentryTest in module Tike.exe at 009B18A6. Just testing Sentry.&quot;</Debugger_RunParams>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<DCC_DebugDCUs>true</DCC_DebugDCUs>

View file

@ -28,6 +28,7 @@ begin
TKeymanSentryClient.Start(TSentryClient, kscpDesktop, LOGGER_DESKTOP_ENGINE_TSYSINFOX64);
try
try
TKeymanSentryClient.Validate;
Run;
except
on E: Exception do

View file

@ -32,6 +32,8 @@ type
procedure DisableUserInterface; safecall;
procedure EnableUserInterface; safecall;
procedure UpdateTouchPanelVisibility(Value: Boolean); safecall;
procedure DiagnosticTestException; safecall;
end;
implementation

View file

@ -147,6 +147,7 @@ const
function CompileKeyboardFile(kmnFile, kmxFile: PChar; FSaveDebug, CompilerWarningsAsErrors, WarnDeprecatedCode: BOOL; CallBack: TCompilerCallback): Integer; cdecl; // I4865 // I4866
function CompileKeyboardFileToBuffer(kmnFile: PChar; buf: PFILE_KEYBOARD; CompilerWarningsAsErrors, WarnDeprecatedCode: BOOL; CallBack: TCompilerCallback; Target: Integer): Integer; cdecl; // I4865 // I4866
procedure Compiler_Diagnostic(mode: Integer);
//
// For unit tests, point to a known-current version of kmcmpdll.dll
@ -265,6 +266,44 @@ begin
Result := ckf(PAnsiChar(AnsiString(kmnFile)), buf, CompilerWarningsAsErrors, WarnDeprecatedCode, Callback, Target); // I3310 // I4865 // I4866
end;
type
TKeyman_Diagnostic = procedure(mode: Integer); stdcall;
procedure Compiler_Diagnostic(mode: Integer);
var
s: string;
keyman_diagnostic: TKeyman_Diagnostic;
begin
// Template copy verbatim from Compile functions; this needs refactoring
if HKMCmpDll = 0 then
begin
s := FUnitTestKMCmpDllPath;
if s = '' then
begin
s := GetDebugKMCmpDllPath;
if (s <> '') and not FileExists(s + kmcmpdll_lib) then // I4770
s := '';
if s = '' then
begin
try
s := GetDeveloperRootPath;
except
s := '';
end;
if s = '' then s := ExtractFilePath(ParamStr(0));
end;
end;
HKMCmpDll := LoadLibrary(PChar(s+kmcmpdll_lib));
if HKMCmpDll = 0 then
Exit;
end;
@keyman_diagnostic := GetProcAddress(HKMCmpDll, 'Keyman_Diagnostic');
if Assigned(@keyman_diagnostic) then
keyman_diagnostic(0);
end;
initialization
finalization

View file

@ -223,5 +223,5 @@ int keyman_sentry_wmain(bool is_keyman_developer, const char *logger, int argc,
void keyman_sentry_test_crash() {
fputs("Testing exception reporting:\n", stderr);
RaiseException(0x00000001, EXCEPTION_NONCONTINUABLE, 0, NULL);
RaiseException(0xDEADBEEF, EXCEPTION_NONCONTINUABLE, 0, NULL);
}