How do I run my Testframe generated in TPT software with an m file in matlab?

11 Ansichten (letzte 30 Tage)
I test models with TPT Software and would like to run the testframe with a m file. Ideally I would like to run TPT with the m file completely. Are there specific functions for TPT Software in Matlab.

Antworten (1)

Robert Reicherdt
Robert Reicherdt am 26 Jun. 2017
Hello,
TPT is an external program for the testing on MATLAB/Simulink models. It enables you to model test cases and execute the test cases within Simulink. However, it is not a Simulink Toolbox - and hence, you cannot run it completely with m-commands.
A possible option would be to run it via a batch call:
tpt.exe --run build <tpt-file> <run-configuration>
For example:
>> !c:\tools\tpt-10\tpt.exe --run build "Lights Control.tpt" "Lights Control MATLAB"
>>>> Test Case "bright ambient; ON 2 OFF 2 AUTO 2 ON [ID: 82] <<<<
>>>> Duration: "8.851s
>>>> Test Case "bright ambient; OFF 2 ON 2 AUTO 2 OFF [ID: 83] <<<<
>>>> Duration: "1.427s
>>>> Test Case "bright ambient; AUTO 2 ON 2 OFF 2 ON [ID: 84] <<<<
>>>> Duration: "1.258s
>>>> Test Case "dark ambient; ON 2 OFF 2 AUTO 2 ON [ID: 77] <<<<
>>>> Duration: "1.228s
>>>> Test Case "dark ambient; OFF 2 ON 2 AUTO 2 OFF [ID: 78] <<<<
>>>> Duration: "1.206s
>>>> Test Case "dark ambient; AUTO 2 OFF 2 ON 2 OFF [ID: 79] <<<<
>>>> Duration: "1.139s
>>>> Test Case "ON changing ambient [ID: 87] <<<<
>>>> Duration: "1.151s
>>>> Test Case "OFF changing ambient [ID: 88] <<<<
>>>> Duration: "1.058s
>>>> Test Case "AUTO changing ambient long [ID: 89] <<<<
>>>> Duration: "1.098s
>>>> Test Case "AUTO changing ambient short dark [ID: 90] <<<<
>>>> Duration: "1.04s
>>>> Test Case "AUTO changing ambient short bright [ID: 94] <<<<
>>>> Duration: "0.887s
>>>> Execution Summary
>> Total: 11
>> Passed: 11
>> Inconclusive: 0
>> Failed: 0
>> Execution Errors: 0
>>>>
Note that will open a new TPT and MATLAB windows.
You can find more information about running TPT in batch mode in the TPT User Guide.
Kind regards
Robert
  2 Kommentare
Aradhana Chaturvedula
Aradhana Chaturvedula am 4 Jul. 2017
Hello ,
Can you please specify the run configuration.
tpt.exe --run build tpt-file run-configuration
I tried the same command, to execute a TPT file with MATLAB configuration through a batch file but i kept getting errors like 'run configuration not found' What exactly are we supposed to mention in the field 'run configuration'? the name as 'MATLAB/Simulink (generated by wizard)' as mentioned in the TPT Platform configuration editor did not help.
Thanks, Aradhana
Jens
Jens am 5 Okt. 2021
When you click on the "Run" button in your TPT project the Execution Configuration shows up where you define all test run specifics such as test environment, subset of tests etc.. It is possible to have several "Execution Configurations" sometimes alos called run configuration. This tells TPT what exactly shall be executed.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by