Unit Test run from script

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
3 posts • Page 1 of 1
ja_ma_
Posts: 10
Joined: Thu Jun 09, 2022 3:56 pm

Unit Test run from script

Post by ja_ma_ »

Is it possible to start all unit tests from a Control script?
I want to start all existing unit tests and check if any failed.

The possible options I have in mind so far:

1. In WinCC OA 3.19 you can start all unit tests by clicking on a folder and selecting "start all unit tests recursiv". Can I use this function in Control?

2. Starting every script file in the tests folder. For this i would need a control function, which justs needs the path to the file and then runs it E.g.: startScript("script path");

3. When creating a unit test file, it automatically creates a unit test class.
E.g.:

Code: Select all

class TstAdd : OaTest
{
...
}

main()
{
  TstAdd test = TstAdd();
  test.startAll();
  exit(0);
}
So far I was not able to use this class in other scripts, because the script can't find this unit test class.

User avatar
kilianvp
Posts: 443
Joined: Fri Jan 16, 2015 10:29 am

Re: Unit Test run from script

Post by kilianvp »

So far I was not able to use this class in other scripts, because the script can't find this unit test class.
Sounds like you didn't added TestFramework_3.19 as subproject.

ja_ma_
Posts: 10
Joined: Thu Jun 09, 2022 3:56 pm

Re: Unit Test run from script

Post by ja_ma_ »

kilianvp wrote: Fri Feb 17, 2023 10:14 am
So far I was not able to use this class in other scripts, because the script can't find this unit test class.
Sounds like you didn't added TestFramework_3.19 as subproject.
I added the TestFramework and I am able to use the OaTest Library. But I am not able to tun the the TestClass (in this example "TstAdd") outside of the file.

Post Reply
3 posts • Page 1 of 1