Skip to content

Use datatype as testsuite name instead of instance path #218

@philippleidig

Description

@philippleidig

Issue

In some cases it is necessary to use the data type of the testsuite instead of the internal instance path in order to be able to assign the test results to the previously parsed test suites afterwards. For example, if the *.plcproj file is parsed to discover test-suites / test-cases, only the data type of the testsuite is present here. The instance path is only available at runtime.

Instance path: MAIN.AxisGeneric_Tests_Instance
Datatype: AxisGeneric_Tests

PROGRAM MAIN
VAR
	AxisGeneric_Tests_Instance : AxisGeneric_Tests;
	DriveGeneric_Tests_Instance : DriveGeneric_Tests;
END_VAR

tcunit_testresults.xml

<testsuite id="0" name="MAIN.AxisGeneric_Tests_Instance" tests="2" failures="1">
    <testcase name="Should_Fail_When_AxisIdIsZero" classname="AxisGeneric_Tests_Instance" status="PASS"></testcase>
</testsuite>

Switching between data type and instance path when generating the name of the execution definition and the test cases would be useful.

Solution

Define a specific parameter for keeping backwards compatibility

image

tcunit_testresults.xml

<testsuite id="0" name="AxisGeneric_Tests" tests="2" failures="1">
    <testcase name="Should_Fail_When_AxisIdIsZero" classname="AxisGeneric_Tests" status="PASS"></testcase>
</testsuite>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions