aggregate coverage data for multiple unit test models

조회 수: 10 (최근 30일)
Han Geerligs
Han Geerligs 2018년 10월 30일
답변: Pat Canny 2018년 11월 12일
hello all,
I am trying to aggregate the coverage data for a referenced model which is shared in two (or more) unit test models. I was wondering how to aggregate the coverage data when running both unit tests.
I have tried the following code:
open_system('unit_test_1.slx');
% modify the data dictionary used by the unit test model and referenced model
cv1=cvsim(bdroot);
open_system('unit_test_2.slx');
% modify the data dictionary used by the unit test model and referenced model
cv2=cvsim(bdroot);
cv_total=cv1+cv2;
cvhtml('test.html',cv_total);
For both unit test models coverage is enabled for the referenced models, thus recording the coverage for the shared reference model. However this approach doesn't work because the concatenation of the cvdata object is failing.
Anyone has a clue how to solve this?
thanks in advance, Han Geerligs
  댓글 수: 1
Pat Canny
Pat Canny 2018년 11월 9일
Hi Han. What do you mean by "concatenation of the cvdata object is failing"? Are you getting an error? Also, what do you mean by "modify the data dictionary"? Are you changing the model between simulations?

댓글을 달려면 로그인하십시오.

채택된 답변

Pat Canny
Pat Canny 2018년 11월 12일
Hi Han,
That is correct. When trying to use the + operator on cvdata from different models, you will get an error.
I recommend contacting MathWorks Support . They might be able to help you with your workflow, though there is no workaround for combining coverage results from different models.

추가 답변 (1개)

Han Geerligs
Han Geerligs 2018년 11월 12일
Hi Pat,
thanks for your swift reply. In the meantime I have gained insights.
Let me explain the context: I am trying to aggregate the coverage results for two unit test models, sharing the same referenced model. One input of the referenced model is a bus. For both unit test models the bus definitions for this input are not equal. So when the referenced model remains loaded between simulatuions of the unit test models I need an update layout command to be able to simulate the second unit test model.
When trying to add both cvdata object I get an conflict which refers to the uniqueID. As I understand this ID is changed when the (strutural) contents of the referenced model are changed. So what I basically try to accomplish is add the coverage results from two structural different reference models.
Can you agree with explanation above?
--Han

카테고리

Help CenterFile Exchange에서 Collect Coverage for Models에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by