0

I am trying to run a few tests on a very simple Simulink model on Matlab 2020a. I have obtained test results by using the Test Manager app, which allows me to set up a test case. The function I created is very simple, it just checks two boolean values and returns another boolean value in accordance to their own value, so I have not reported it here.

My procedure is as follows:

From Simulink Test Manager -> New Test File -> Test For Model Component -> Importing both Top Model and Component to create a Harness -> Using Design Verifier options (with the only changes from the default values being (1) Test Generation -> Model Coverage Objectives : MCDC ; and (2) Report -> Generate report of results) and IMPORTING Test harness inputs as a source -> Use component under test output as baseline -> saving data as an Excel sheet. Tests are then generated and everything is working fine. I then use a small python script to edit the Excel file, generating an Oracle with a structure like this:

time   Var_A        Var_B       time       Out1:1
                                           AbsTol:0
       type:boolean type:boolean           Type:int8
       Interp:zoh   Interp:zoh             Interp:zoh
0          0            1           0          0
0.4        1            1           0.4        1
0.8        0            0           0.8          TRUE

After this, I have to let Simulink write a PDF report of the project. To do so, I set up the following options:

From the test harness: Inputs -> Include input data in test result; Stop simulation at last time point; Baseline Criteria -> Include baseline data in test result; Coverage Settings -> Record coverage for system under test; Record coverage for referenced models;

From the top level test folder: Coverage Settings -> Record coverage for system under test; Record coverage for referenced models; Coverage Metrics: Decision; Condition; MCDC; Test File Options-> Close all open figures at the end of execution; Generate report after execution (with author and file path); Include Matlab version; Results for: All tests; Test Requirements; Plots of criteria and assessments; Simulation metadata; Error log and messages; Coverage results; File format PDF.

Then I let it run. The test manager tells me everything went fine, but for some reason, whenever it has to create a report, it throws me an error:

X_component_test: Input argument #1 is an invalid cvdata object. CVDATA objects become invalid when their associated models are closed or modified

Now, I am sure this worked fine before with much more complex components, but I have no idea what am I doing wrong here. Anyone got a clue?

1 Answer 1

0

In the end, the solution was much more simple than I thought. Just delete all .cv files and clean up your project's folder of all test files or unnecessary files. Matlab seems to have issues when there's way too many present. Also the script had to be modified to remove that TRUE value and replace it with a 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.