Qt Inject Windows/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „== Required Files == To inject the expecco test code in your application you need 3 files. All files are in the ''qt client directory'':<br> <code><expecco-i…“)
 
 
(17 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
== Inject ExpeccoTestService-Library (recommended)==
== Required Files ==

=== Required Files ===


To inject the expecco test code in your application you need 3 files.
To inject the expecco test code in your application you need 3 files.


All files are in the ''qt client directory'':<br>
All files are in the ''qt client directory'':<br>
<code><expecco-installaton-dir>\packages\exept\expecco\plugin\qt\expeccoQtClient\expeccoTestService</code>
<code><expecco-installaton-dir>\packages\exept\expecco\plugin\qt\expeccoQtClient</code>

==== Expecco Qt Inject Script ====

Batch script to start your application with the expecco test code injected.

You have to change the file according to your setup.


=== Expecco Test Service Library ===
Filename: <br>
Filename: <br>
<code>ExpeccoTestService.dll</code>
<code>ets_Inject-template.bat</code>


Location:<br>
Location: <br>
<code><qt client directory>\bin\<CompilerVersion>_<CompilerArchitecture>_Qt<QtVersion>\</code>
<code><qt client directory>\expeccoTestService_InjectTool\injectScript\</code>

==== Expecco Qt Inject Program ====

Program to inject the expecco test code.


=== Expecco Qt Inject Program ===
Filename: <br>
Filename: <br>
<code>etsInject.exe</code>
<code>etsInject.exe</code>


Location: <br>
Location: <br>
<code><qt client directory>expeccoTestService_InjectTool\bin\<CompilerVersion>\<CompilerArchitecture>\</code>
<code><qt client directory>\expeccoTestService_InjectTool\bin\<CompilerVersion>\<CompilerArchitecture>\</code>


=== Expecco Qt Inject Script ===
==== Expecco Test Service Library ====

Library with the expecco test code.


Filename: <br>
Filename: <br>
<code>ExpeccoTestService.dll</code> or <code>ExpeccoTestService_V2.dll</code> (QtQuick)
<code>ets_Inject-template.bat</code>


Location: <br>
Location:<br>
<code><qt client directory>\expeccoTestService_InjectTool\injectScript</code>
<code><qt client directory>\bin\<CompilerVersion>_<CompilerArchitecture>_Qt<QtVersion>\</code>

=== Expecco Qt Inject Script ===

You have to define the paths according to you setup int the Expecco Qt Inject Script 'ets_Inject-template.bat':

==== QTDIR ====

Path of the QT directory on your system, dependent on qt and compiler version.

Example <br>
<code>C:\QT\5.15.0\msvc2019_64</code>

==== ExpeccoTestServiceInject ====

Path and filename of the 'Expecco Qt Inject Program'.

==== ExpeccoTestService ====

Path and filename of the 'Expecco Test Service Library'

==== ApplicationDirectory, ApplicationName ====

Directory and name of the application to be tested.

==== Terminate running Test Application ====

To stop and then restart a running test application, set the value of TERMINATE_RUNNING_APP in the script to 'true' (default value: 'false').

=== Logging ===

To activate logging, remove the comment from two lines in the 'Expecco Qt Inject Script' and adjust the log level.

set ETS_QT_LOG_FILE=c:\\Windows\\temp\\etsQt.log
set ETS_QT_LOG_LEVEL=<loglevel as number or text>

==== Log Level ====
===== Expecco version before 24.1 =====
Every numerical value > 0 activates debug logging
set ETS_QT_LOG_LEVEL=2

==== From expecco version 24.1 ====
The valid values for loglevel are:<br>

{| class="wikitable"
|-
! Value as Number !! Value as Text !! Loglevel
|-
| <code>0</code>|| || No logging
|-
| <code>2</code>|| <code>DEBUG</code> ||>= Debug
|-
| <code>3</code>|| <code>INFO</code>|| >= Info
|-
| <code>4</code>|| <code>WARN</code> || >= Warning
|}
set ETS_QT_LOG_LEVEL=DEBUG

=== Start ===

Start the modified 'Expecco Qt Inject Script'.

== Insert into Source Code (alternative)==

=== Code modifications ===

==== Source (main.cpp) ====

Add to header:

extern "C" {
void ETSServerInitializeBaseC(void);
}

Add the initialization call to the main method after the QApplication call:

int main(int argc, char *argv[]) {
...
QApplication a(argc, 0);
...
ETSServerInitializeBaseC();
...
}

==== Build File (xxx.pro) ====

Add the ExpeccoTestService library in the linker path

LIBS += -L<path/to/ExpeccoTestService> -lExpeccoTestService

----

Back to [[Qt Plugin Reference/en|Qt Plugin Reference]]

Aktuelle Version vom 27. März 2024, 10:46 Uhr

Inject ExpeccoTestService-Library (recommended)[Bearbeiten]

Required Files[Bearbeiten]

To inject the expecco test code in your application you need 3 files.

All files are in the qt client directory:
<expecco-installaton-dir>\packages\exept\expecco\plugin\qt\expeccoQtClient

Expecco Qt Inject Script[Bearbeiten]

Batch script to start your application with the expecco test code injected.

You have to change the file according to your setup.

Filename:
ets_Inject-template.bat

Location:
<qt client directory>\expeccoTestService_InjectTool\injectScript\

Expecco Qt Inject Program[Bearbeiten]

Program to inject the expecco test code.

Filename:
etsInject.exe

Location:
<qt client directory>\expeccoTestService_InjectTool\bin\<CompilerVersion>\<CompilerArchitecture>\

Expecco Test Service Library[Bearbeiten]

Library with the expecco test code.

Filename:
ExpeccoTestService.dll or ExpeccoTestService_V2.dll (QtQuick)

Location:
<qt client directory>\bin\<CompilerVersion>_<CompilerArchitecture>_Qt<QtVersion>\

Expecco Qt Inject Script[Bearbeiten]

You have to define the paths according to you setup int the Expecco Qt Inject Script 'ets_Inject-template.bat':

QTDIR[Bearbeiten]

Path of the QT directory on your system, dependent on qt and compiler version.

Example
C:\QT\5.15.0\msvc2019_64

ExpeccoTestServiceInject[Bearbeiten]

Path and filename of the 'Expecco Qt Inject Program'.

ExpeccoTestService[Bearbeiten]

Path and filename of the 'Expecco Test Service Library'

ApplicationDirectory, ApplicationName[Bearbeiten]

Directory and name of the application to be tested.

Terminate running Test Application[Bearbeiten]

To stop and then restart a running test application, set the value of TERMINATE_RUNNING_APP in the script to 'true' (default value: 'false').

Logging[Bearbeiten]

To activate logging, remove the comment from two lines in the 'Expecco Qt Inject Script' and adjust the log level.

set ETS_QT_LOG_FILE=c:\\Windows\\temp\\etsQt.log
set ETS_QT_LOG_LEVEL=<loglevel as number or text>

Log Level[Bearbeiten]

Expecco version before 24.1[Bearbeiten]

Every numerical value > 0 activates debug logging

set ETS_QT_LOG_LEVEL=2

From expecco version 24.1[Bearbeiten]

The valid values for loglevel are:

Value as Number Value as Text Loglevel
0 No logging
2 DEBUG >= Debug
3 INFO >= Info
4 WARN >= Warning
set ETS_QT_LOG_LEVEL=DEBUG

Start[Bearbeiten]

Start the modified 'Expecco Qt Inject Script'.

Insert into Source Code (alternative)[Bearbeiten]

Code modifications[Bearbeiten]

Source (main.cpp)[Bearbeiten]

Add to header:

 extern "C" {
   void ETSServerInitializeBaseC(void);
 }

Add the initialization call to the main method after the QApplication call:

 int main(int argc, char *argv[]) {
   ...
   QApplication a(argc, 0);
   ...
   ETSServerInitializeBaseC();
   ...
 }

Build File (xxx.pro)[Bearbeiten]

Add the ExpeccoTestService library in the linker path

 LIBS     += -L<path/to/ExpeccoTestService> -lExpeccoTestService

Back to Qt Plugin Reference



Copyright © 2014-2024 eXept Software AG