kbLogger 2.0.b1
The automotive ready test and logging program.
Test

Description:
The TestObject is used for full automatic testing like smoke tests and CI tests. Like the ScriptObject, the script interpreter is a JavaScript implementation which comes with the usage of the Qt framework from the Qt Group.

As described in the Qt documentation, QtScript is based on the ECMAScript scripting language, as defined in standard ECMA-262. Microsoft's JScript, and Netscape's JavaScript are also based on the ECMAScript standard. For an overview of ECMAScript, see the ECMAScript reference. If you are not familiar with the ECMAScript language, there are several existing tutorials and books that cover this subject, such as JavaScript: The Definitive Guide.

The JavaScript interpreter runs in the main thread (the GUI thread) of kbLogger. This makes it impossible to use blocking functions except Script::sleep().

Since the TestObject uses an instance of the class Script with the name "so", which means "script object", the correct function call for its functions is

so.functionToCall(param);

You can find more about the usage of the functions of the script object at its description.

The TestObject is using also an instance of the class ConfigItemTestObject with the name "to", the correct function call for its functions is

to.functionToCall(param);

You can find more about the usage of the functions of the TestObject at its description.

In case of using the trace(text) function, which is included in both objects (so and to), inside of the TestObject you should use to.trace(text). Otherwise there will be a context switch before the text is appearing in the TraceWindow. This can looks like the trace output came from the next running test.

The Test

Creating a Test

Do a right-click on an empty place in the ConfigViewer of your project and choose "New TestObject".

Creating a new TestObject

Configure the TestObject

Double click on the TestObject to open the configure dialog.

TestObject configure dialog

Test Name:
The edit field "Test Name" contains at first a generic name like "Test1". This user changeable name is used to identify the ConfigItem in the TraceViewer or LogViewer. This name can also be used as sender or receiver name for massages.