Parameterized tests - Manual - AxUnit-ST - AxUnit ST documentation package - AxUnit-ST,

AxUnit-ST CLI Tool (test)

Portfolio
SIMATIC AX
Product
AxUnit-ST
Software version
8.0.33
Edition
04/2025
Language
English (original)
Package Name
@ax/axunitst-docs

For each pragma the test will be executed separately. Parameters have to be defined in the VAR_INPUT section. The test run parameters can be defined using the following notation:

{Test(value := 1)}
{Test(value := 2)}
{Test(value := 32767)}
FUNCTION PUBLIC TheAddOfPositiveValueToMaxIntReturnsNegativeValue
    VAR_INPUT
        value: INT;
    END_VAR
    // some test code
    ;
END_FUNCTION
{Test(value1 := 1, value2:= 2)}
{Test(10, 20)}
FUNCTION PUBLIC AddingTwoNumbersReturnsTheSum
    VAR_INPUT
        value1: INT;
        value2: INT;
    END_VAR
    // some test code
    ;
END_FUNCTION

WARNING

  • Every parameter must be assigned in the pragma if parameters are specified.
  • Casing and ordering is not relevant if named parameters are used.
  • Elementary data types are supported as arguments.