Skip to content

Ordered tests running multiple times for SPT project tests #272

Description

@sgaforbes84

Describe the issue
When running TEST_ORDERED() to test an SPT framework project I'm finding that tests are being executed twice. If I only create 1 test suite I get messages 'Test with name 'MyTest' already exists in the test suite 'MyTestSuite1', but the tests run successfully in this case. If I add a second test suite I get the 'Test already exists' messages for tests in the 2nd test suite and the tests in the 1st test suite run multiple times until all tests have finished.

The FB I'm testing is instantiated in PRG_TEST and a pointer to that FB is passed as an input to the Test Suite FB - this seemed the best fit to combine the SPT framework with TcUnit. I have also added a manual trigger to delay the running of my tests to allow the SPT libraries to 'initialise' the machine before testing any of my added code.

To Reproduce

Reproducing with the complete SPT project is I think excessive, and my suspicion is that I've laid out the TcUnit code incorrectly, so...
Create a test suite with more than 1 test that are run with IF TEST_ORDERED
Instantiate a FB to test in PRG_TEST, pass a pointer to that FB in to the test suite FB
Run tests 

Expected behaviour
The tests are run once in order to completion

Screenshots

Software versions
Tc4026, latest TcUnit

Run environment
W11, local runtime

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions