Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.15 KB

README.md

File metadata and controls

39 lines (31 loc) · 1.15 KB

Pic

SimpleUnitTestLibrary

A lightweight unit test library for testing TwinCAT3 source code with the following goals:

  1. Impose minimum setup cost for a new test
  2. Provide a Gui to show test results
  3. Support re-testing after an online change
  4. Support concurrent and sequential test execution

To create a test:

  • Inherit from a base class
  • Create an instance
  • Call TestFinished()

To run all the tests together, call:

tcl_SimpleUnitTestLibrary.TestFramework.TestRunner(RunTestsSequentially := FALSE);

To run all the tests one after another, call:

tcl_SimpleUnitTestLibrary.TestFramework.TestRunner(RunTestsSequentially := TRUE);

To stop tests from running automatically on download or (re)init, call:

tcl_SimpleUnitTestLibrary.TestFramework.TestRunner(ManualTestRunsOnly := TRUE);

Options can be combined in any way. I.e. call:

// Run tests concurrently, but only with press of Visualisation button 
tcl_SimpleUnitTestLibrary.TestFramework.TestRunner(
    RunTestsSequentially := FALSE,
    ManualTestRunsOnly := TRUE
);