testbed踩坑:New Test Case cannot be added to the sequence....

[复制链接]
212|5
手机看帖
扫描二维码
随时随地手机跟帖
keer_zu|  楼主 | 2023-1-12 16:11 | 显示全部楼层
在initialisation code中添加:ldra_qq_quiet_stubs=1; 再执行用例
ldra_qq_quiet_stubs=1;的作用是不打印桩函数log

使用特权

评论回复
keer_zu|  楼主 | 2023-1-12 16:14 | 显示全部楼层
这样的结果是不再报上面的错误,弹框可以看到PASS

但是覆盖结果仍然是:


6076063bfc12817182.png

且可以看到日志:
3635163bfc15520a8e.png

Execution History Directory:
d:\LDRA\unit\workarea\tbwrkfls\EMClient_EMClient_1_seqwrkfls\

Validating Execution History File
d:\LDRA\unit\workarea\tbwrkfls\EMClient_EMClient_1_seqwrkfls\EMClient_1.exh


Split Execution History File:
d:\LDRA\unit\workarea\tbwrkfls\EMClient_EMClient_1_seqwrkfls\EMClient_1.exh


Dynamic Coverage Analysis

           ***********************************************************
           ****     IMPLEMENTATION RESTRICTION IN LDRA TESTBED    ****
           ****                                                   ****
           ****           CONTACT SUPPORT EITHER LOCALLY          ****
           ****              OR AT LDRA LTD (U.K.) ON             ****
           ****                                                   ****
           ****            TEL.     +44 (0)151 649 9300           ****
           ****            FAX.     +44 (0)151 649 9666           ****
           ****            E-mail   support@ldra.com              ****
           ****                                                   ****
           ****           QUOTING THE FOLLOWING MESSAGES          ****
           ****                                                   ****
           ***********************************************************

ERROR  104 OCCURRED IN DYNAMIC COVERAGE ANALYSIS

State of Dynamic Coverage Analysis when error occurred
======================================================
Execution history type                   =     10
Execution history number                 =      1
Number of execution history records read =       29
Current execution history pair           =    135     0


Attempt to look at top of empty stack.

This usually occurs when the execution history data associated with
procedure confirms (instrumentation at the first executable line of the
procedure) or procedure returns (instrumentation immediately preceding
return statements) is missing from the execution history trace that is
presented to the tool suite for analysis.


You have encountered an error in Dynamic Coverage Analysis. Please check
whether your code is multi-tasking or multi-processing. If it is you will have
to add a task or process ID to your instrumentation data file, re-instrument
and utilise DynSplit to separate all of the tasks from the execution history
prior to Dynamic Coverage Analysis.
Please see the Instrumentation section of the User Manual for further details.

If the problem persists, before contacting LDRA please create a zip or
compressed tar file containing the following files:

   The SIR file that appears when you press the F6 key.
The instrumentation file (i.e. <lang>instr.dat).
   This error message you are reading now.
   The source file under analysis.
   The instrumented version of the source file.
The execution history file (i.e. history.exh or <sourcefile>.exh)

   The following workfiles generated by LDRA Testbed. These will be located in
the tbwkfls or <setname>_tbwrkfls directory:

<sourcefile>.bra
<sourcefile>.dtb
<sourcefile>.ibr
<sourcefile>.ref
<sourcefile>.stb
<sourcefile>.tib
<sourcefile>.xbr
<sourcefile>.xtx

   It is possible not all of the workfiles listed appear
   in your system. Please send those you have.

E-mail these files in a compressed single file archive (zip file) to LDRA at:

     support@ldra.com
Dynamic Files stored after error

Archiving Execution History File:
d:\LDRA\unit\workarea\tbwrkfls\EMClient_1.exc
To: d:\LDRA\unit\workarea\tbwrkfls\dyn_archive_EMClient_1_27\

Analysis failure occurred, repeating analysis with empty execution history.
Additional Execution History generated:
STREAM3.DAT



Unable to archive - no valid Execution history

TBreports generation
Generating:
Test Manager Report
Dynamic Coverage Report


Command Line Mode Finished
Dynamic analysis completed for
Z:\src\basic_service\EM\src\EMClient\EMClient.cpp.


使用特权

评论回复
keer_zu|  楼主 | 2023-1-12 16:17 | 显示全部楼层
桩函数的log有些错位:

# cat EMClient.sop
N 2;1 1 16 1 V
M ***
M *** Starting Stub : nobo::infra::em::EMCommProxy::EMCommProxy
M ***
P S nobo::infra::em::EMCommProxy::EMCommProxy
P E V
M ###
M ### Ending Stub : nobo::infra::em::EMCommProxy::EMCommProxy
M ###
M ***
M *** Starting Stub : nobo::infra::em::EMCommProxy::registerMessageHandler
M ***
P S nobo::infra::em::EMCommProxy::registerMessageHandler
P E V
M ###
M ### Ending Stub : nobo::infra::em::EMCommProxy::registerMessageHandler
M ###
I V Z alive
E true
I V M mClient
E pclient
C V
O V N mClient->serverAlive
M ***
E
M *** Starting Stub : nobo::infra::em::EMCommProxy::resIdle
P M ***
VP S nobo::infra::em::EMCommProxy::resIdle
P E V
trueM ###

M ### Ending Stub : nobo::infra::em::EMCommProxy::resIdle
O V O %
M ###
E
P V 0
D


使用特权

评论回复
keer_zu|  楼主 | 2023-1-12 16:19 | 显示全部楼层
此时test case的设置:

Initialisation code:

/*
* Test case initialisation code will be placed here
* Variables declared in this section do not have global scope
* Some compilers may not allow declarations here
*/
/* Uncomment the function call below to call the file-based test case initialisation code
* This function can perform common test case initialisation for multiple test cases
*  ldra_qq_file_tc_init_code ();
*/
ldra_qq_quiet_stubs=1;
pclient = &nobo::infra::em::EMClient::getInstance(nobo::infra::em::FG_IPC);
pclient->init(testPrint);


Global Declarations:

/*
* Test case global declaration code will be placed here
* Variables declared in this section are at global scope
*/
nobo::infra::em::EMClient* pclient;
void testPrint(int level, const char *format, ...){
        va_list arg;
        va_start(arg, format);
        vprintf(format, arg);
        va_end(arg);
}


使用特权

评论回复
keer_zu|  楼主 | 2023-1-12 16:28 | 显示全部楼层
再看当前sequence模式不是unit testing

7534163bfc480e2b93.png

需要选这个,ok,再试一下

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:qq群:49734243 Email:zukeqiang@gmail.com

1304

主题

12233

帖子

53

粉丝