Controlling test execution via the command line
The fcfTest library provides a flexible system for test filtering and logging configuration using command-line arguments. This allows you to run only the necessary test groups, exclude problematic areas, or change the output verbosity without recompiling the code.
The
--test-run- forces the execution of selected tests. Used iffcf::NTest::cmdRun is called with thefcf::NTest::CRM_EXECUTE orfcf::NTest::CRM_PARSE flag.--test-list- displays a list of all registered tests in the hierarchy (Part -> Group -> Test).--test-help- displays help information regarding available parameters.--test-no-break- if this parameter is specified, the execution of the remaining tests is not interrupted in case of a test failure.
Filtering works on the principle of inclusion or exclusion. Parameters can be used multiple times to combine conditions.
| Parameter | Description |
|---|---|
--test-part NAME |
Run only tests belonging to the specified part. |
--test-group NAME |
Run only tests belonging to the specified group. |
--test-test NAME |
Run only a specific test by its name. |
--test-select [PART] [GROUP] [TEST] |
Runs only tests that satisfy the selector specified by the three parameters.
If a parameter is an empty string or Multiple values can be provided in a parameter, separated by the Example: |
--test-ignore-part NAME |
Exclude the specified part from execution. |
--test-ignore-group NAME |
Exclude the specified group from execution. |
--test-ignore-test NAME |
Exclude a specific test from execution. |
--test-ignore-select PART GROUP TEST |
Exclude tests that satisfy the selector specified by the three parameters.
If a parameter is an empty string or Multiple values can be provided in a parameter, separated by the |
Explanatory details:
- The --test-part, --test-group, --test-test, --test-select commands are combined using the OR operation
- The --test-ignore-part, --test-ignore-group, --test-ignore-test, --test-ignore-select commands are combined using the OR operation
The framework supports an additional JUnit XML output format for integration with other automated testing systems.
| Parameter | Description |
|---|---|
--test-format FORMAT |
Specifies the format of terminal output.
By default, the format parameter can take only two values:
|
The test execution results can be written to a separate file with the desired format.
| Parameter | Description |
|---|---|
--test-file FILE |
The test execution result will be written to the file. The file format is determined by the --test-format parameter. Default is "default". |
--test-file-FORMAT FILE |
Writes the test execution result to a file with the specified format.
Example of writing in default format:
Example of writing in junit format: |
The --test-log-level LEVEL parameter sets the logger's sensitivity threshold. Messages with a level lower than the specified one will be ignored.
off — logging is disabled.ftl — Fatal (critical errors).err — Error (errors).wrn — Warning (warnings).att — Attention (notices).log — Log (standard level, default).inf — Info (information).dbg — Debug (debugging).trc — Trace (tracing).all — All levels.def — Uses the application's default logging level (which islog by default).
1. Running a specific test group with extended logging:
2. Running all tests except for the "Integration" part and the "Legacy" group:
3. Viewing the list of all available tests:
4. Running one specific test:
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.