I want to know the difference between the "CAPL Test Functions" and normal functions (Like in C or C++) which can be used in CAPL ?? Under which scenario should I use TestFunctions ?? Thanks.
3 Answers
Test functions are mainly used for test nodes which is used for running test cases (defined in an XML file) and provide reports about the results.
Normal functions can be used in test/simulation/program nodes

- 51
- 2
Internally pre-defined CAPL functions does not require function libraries or linking header files to use and compile these functions. CAPL's internal library provides functions in 3 categories. 1. capl's internal library 2. user defined functions 3. Dll functions, which require user to implement a dynamic linked library.

- 1
The idea behind test function and normal functions is quite simple. You can use both in Vector CANoe (test modules) and vTEST Studio. BTW. To make function visible in outter scope you use 'export' keyword.
Test Functions:
- they are always top-most (cannot be nested or executed by any other function)
- does not return anything
- provides additional logging in Vector CANoe test reports (visible either in HTML/XML based or CANoe Test Report Viewer)
- use it only in CAPL Test Modules as 'test steps' of test cases (top most functions)
Casual Functions:
- might be called by other functions and test functions
- might have a return
- executing a function does not influence test logs directly (only information added by testStep, testStepPassed etc. will be added in test report)
- use them in test cases only when you want to return some values (test functions cannot be used in this case)
- use them as smaller pieces of test functions

- 463
- 8
- 22