You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Tests defined used TEST_ORDERED() do not appear to calculate the duration correctly.
A quick look into the code reveals that the Test StartedAt may not be set, as shown in this screenshot for SetFinishedAndDuration().
It looks like a simple fix to the TEST_ORDERED FC to add Test.SetStartedAtIfNotSet(Timestamp := F_GetCpuCounterAs64bit(GVL_TcUnit.GetCpuCounter)); is necessary. I will try to submit a PR as soon as I have time for this.
To Reproduce
Run any set of tests that include TEST_ORDERED tests. For example TestCase1C will be calculated incorrectly while TestCase1D is correct.
IFTEST_ORDERED('TestCase1C') THENAssertTrue(TRUE, 'Condition is not true');
TEST_FINISHED();
END_IFTEST('TestCase1D');
AssertTrue(FALSE, 'Condition is not true');
AssertTrue(TRUE, 'Condition is not true');
TEST_FINISHED();
Expected behavior
The duration should be calculated for the overall length of time that the test takes.
Software versions
1.3.0.0
Run environment
Hardware PLC
The text was updated successfully, but these errors were encountered:
@sagatowski yes, I am using TcUnit-VsExtension + the adapter using the branch I am working on at TcUnit-VsTestAdapter that can parse out tests via the TMC file and regex parsing for TEST and TEST_ORDERED sections. The fonts and colors I think are just defaults in TwinCAT VS 2019 although maybe I adjusted something at one point. The font is Consolas.
Describe the bug
![image](https://private-user-images.githubusercontent.com/3814449/288617312-796f4e47-c717-4c91-923f-1a5301c6109f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg2Mzg5NDcsIm5iZiI6MTcxODYzODY0NywicGF0aCI6Ii8zODE0NDQ5LzI4ODYxNzMxMi03OTZmNGU0Ny1jNzE3LTRjOTEtOTIzZi0xYTUzMDFjNjEwOWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTdUMTUzNzI3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWZmYTI5OGMzYWMwMzE0OTgyMjU0M2FlYjZmMjMxY2YwNTBhMTMyOTA4YWNhNTZjMzg5ZDIwMTM3YmM1ZGZhMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.e7xcMCnO0WiEq8vb5PEWRgf87InBvseN-bZxFsL6hLQ)
Tests defined used
TEST_ORDERED()
do not appear to calculate the duration correctly.A quick look into the code reveals that the Test StartedAt may not be set, as shown in this screenshot for
![image](https://private-user-images.githubusercontent.com/3814449/288617377-1c639419-1361-436b-9ed6-1fc00187dbc8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg2Mzg5NDcsIm5iZiI6MTcxODYzODY0NywicGF0aCI6Ii8zODE0NDQ5LzI4ODYxNzM3Ny0xYzYzOTQxOS0xMzYxLTQzNmItOWVkNi0xZmMwMDE4N2RiYzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTdUMTUzNzI3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWIzZTU0MmIyYWJmMTc3MTFhY2JiY2I1ZjUxNzg4NDZkN2FjYTFkYjQzZWUxYWUzYWZlNzA2YjA2NmI0YWFjYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.H7uMzYV4IjmGreP1rgYr6B8uIaVFsgcPMd19EqZwqSs)
SetFinishedAndDuration()
.It looks like a simple fix to the
TEST_ORDERED
FC to addTest.SetStartedAtIfNotSet(Timestamp := F_GetCpuCounterAs64bit(GVL_TcUnit.GetCpuCounter));
is necessary. I will try to submit a PR as soon as I have time for this.To Reproduce
Run any set of tests that include
TEST_ORDERED
tests. For exampleTestCase1C
will be calculated incorrectly while TestCase1D is correct.Expected behavior
The duration should be calculated for the overall length of time that the test takes.
Software versions
1.3.0.0
Run environment
Hardware PLC
The text was updated successfully, but these errors were encountered: