Qt Inject Windows/en: Unterschied zwischen den Versionen
Alkurz (Diskussion | Beiträge) |
Alkurz (Diskussion | Beiträge) K |
||
Zeile 1: | Zeile 1: | ||
== Inject expeccoTestService-Library == |
|||
== QT == |
|||
⚫ | |||
https://www.qt.io/download |
|||
⚫ | |||
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. |
||
Zeile 10: | Zeile 8: | ||
<code><expecco-installaton-dir>\packages\exept\expecco\plugin\qt\expeccoQtClient\expeccoTestService</code> |
<code><expecco-installaton-dir>\packages\exept\expecco\plugin\qt\expeccoQtClient\expeccoTestService</code> |
||
=== Expecco Qt Inject Script === |
==== 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. |
Batch script to start your application with the expecco test code injected. You have to change the file according to your setup. |
||
Zeile 20: | Zeile 18: | ||
<code><qt client directory>\expeccoTestService_InjectTool\injectScript\</code> |
<code><qt client directory>\expeccoTestService_InjectTool\injectScript\</code> |
||
=== Expecco Qt Inject Program === |
==== Expecco Qt Inject Program ==== |
||
Program to inject the expecco test code. |
Program to inject the expecco test code. |
||
Zeile 30: | Zeile 28: | ||
<code><qt client directory>\expeccoTestService_InjectTool\bin\<CompilerVersion>\<CompilerArchitecture>\</code> |
<code><qt client directory>\expeccoTestService_InjectTool\bin\<CompilerVersion>\<CompilerArchitecture>\</code> |
||
=== Expecco Test Service Library === |
==== Expecco Test Service Library ==== |
||
Library with the expecco test code. |
Library with the expecco test code. |
||
Zeile 40: | Zeile 38: | ||
<code><qt client directory>\bin\<CompilerVersion>_<CompilerArchitecture>_Qt<QtVersion>\</code> |
<code><qt client directory>\bin\<CompilerVersion>_<CompilerArchitecture>_Qt<QtVersion>\</code> |
||
== Expecco Qt Inject Script == |
=== Expecco Qt Inject Script === |
||
You have to define the paths according to you setup int the Expecco Qt Inject Script 'ets_Inject-template.bat': |
You have to define the paths according to you setup int the Expecco Qt Inject Script 'ets_Inject-template.bat': |
||
=== QTDIR === |
==== QTDIR ==== |
||
Path of the QT directory on your system, dependent on qt and compiler version. |
Path of the QT directory on your system, dependent on qt and compiler version. |
||
Zeile 51: | Zeile 49: | ||
<code>C:\QT\5.9.1\msvc2017_64</code> |
<code>C:\QT\5.9.1\msvc2017_64</code> |
||
=== ExpeccoTestServiceInject === |
==== ExpeccoTestServiceInject ==== |
||
Path and filename of the 'Expecco Qt Inject Program'. |
Path and filename of the 'Expecco Qt Inject Program'. |
||
=== ExpeccoTestService === |
==== ExpeccoTestService ==== |
||
Path and filename of the 'Expecco Test Service Library' |
Path and filename of the 'Expecco Test Service Library' |
||
=== ApplicationDirectory, ApplicationName === |
==== ApplicationDirectory, ApplicationName ==== |
||
Directory and name of the application to be tested. |
Directory and name of the application to be tested. |
||
== Logging == |
=== Logging === |
||
You can activate the logging by removing the comment of two lines of the 'Expecco Qt Inject Script' and modifying the log level. |
You can activate the logging by removing the comment of two lines of the 'Expecco Qt Inject Script' and modifying the log level. |
||
Zeile 70: | Zeile 68: | ||
set ETS_QT_LOG_LEVEL=2 |
set ETS_QT_LOG_LEVEL=2 |
||
== Start == |
=== Start === |
||
Start the modified 'Expecco Qt Inject Script'. |
Start the modified 'Expecco Qt Inject Script'. |
||
== Insert into Source Code == |
|||
=== 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 Fill (xxx.pro) ==== |
|||
Add the ExpeccoTestService library in the linker path |
|||
LIBS += -L<path/to/ExpeccoTestService> -lExpeccoTestService |
Version vom 16. November 2021, 09:06 Uhr
Inhaltsverzeichnis
Inject expeccoTestService-Library[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\expeccoTestService
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
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.9.1\msvc2017_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.
Logging[Bearbeiten]
You can activate the logging by removing the comment of two lines of the 'Expecco Qt Inject Script' and modifying the log level.
set ETS_QT_LOG_FILE=c:\\Windows\\temp\\etsQt.log set ETS_QT_LOG_LEVEL=2
Start[Bearbeiten]
Start the modified 'Expecco Qt Inject Script'.
Insert into Source Code[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 Fill (xxx.pro)[Bearbeiten]
Add the ExpeccoTestService library in the linker path
LIBS += -L<path/to/ExpeccoTestService> -lExpeccoTestService