System Testing in a Multi-Threaded or RTOS Environment

System Testing for C

When Virtual Testers must be executed as a threaded part of a UNIX or Windows process, or on RealTime Operating Systems (RTOS) you must take several constraints into account:

  • The Virtual Tester should be generated as a function and not a main program.

  • You must consider the configuration of the Virtual Testers' execution.

There are memory management constraints:

  • There is no dynamic memory allocation.

  • Stacks are small.

  • Virtual Testers share global data.

  • Configuration of Virtual Tester execution.

Virtual Tester as a Thread or Task

When using a flat-memory RTOS model, the Virtual Testers can run as a process thread or as a task in order to avoid conflicts with the application under test's global variables.

Moreover, the Target Deployment Port is fully reentrant. Therefore, you can run multiple instances of a Virtual Tester in the same process. The system runs each process as a different process thread.

In this case, the Test Script Compiler generates the virtual tester source code without a main() function, but with a user function.

To configure System Testing to run in multi-threaded mode, select the Not shared option in Test Script Compiler Settings.

Multiple Instances of a Same Virtual Tester

Multiple instances of a same Virtual Tester can run simultaneously on a same target. In this case, you need to protect the Virtual Tester threads in the same process against access to global variables.

The Not Shared setting in Test Script Compiler Settings allows you to specify global variables in the test script that should remain unshared by separate Virtual Tester threads. When selected, multiple instances of a Virtual Tester can all run in the same process.

You can share some global static variables in order to reuse data among different Virtual Testers by using the SHARE command in the .pts test script. See the Reference section for information about the System Testing Language.

Related Topics

About Virtual Testers | System Testing in a Multi-Threaded or RTOS Environment | Test Script Compiler Settings