基本上我有两个断点,让我们说A和B.我写了一个.cmm脚本进行自动化测试,我想知道你怎么看断断点A在断点B之前到达了。基于这个假设有一个条件通过或未通过测试。下面的代码只显示是否达到了断点并且它们是。
GO A
TOOLBOX WaitValidateBreakpoint A
ENTRY &StoppedAtBreakpoint
IF &StoppedAtBreakpoint==FALSE()
(
TOOLBOX TestStepFail "Breakpoint A is not reached"
RETURN
)
ELSE
(
TOOLBOX TestStepPass "Breakpoint A is reached"
RETURN
)
GO B
TOOLBOX WaitValidateBreakpoint B
ENTRY &StoppedAtBreakpoint
IF &StoppedAtBreakpoint==FALSE()
(
TOOLBOX TestStepFail "Breakpoint B is not reached"
RETURN
)
ELSE
(
TOOLBOX TestStepPass "Breakpoint B is reached"
RETURN
)
答案 0 :(得分:1)
由于问题描述,我假设现有的自动化脚本能够检测是否命中了断点A或B.这由两个包含两个断点地址的PRACTICE宏反映出来:
LOCAL &address_bp_a &address_bp_b
另外两个PRACTICE宏跟踪首先触发的断点:
LOCAL &bp_a_first &bp_b_first
&bp_a_first=FALSE()
&bp_b_first=FALSE()
脚本启动程序执行并监视首先触发的断点。如果遇到其他断点,则会在循环中发生这种情况:
WHILE !(&bp_a_first||&bp_b_first)
(
Go
WAIT !STATE.RUN()
IF Register(PC)==&address_bp_a
(
&bp_a_first=TRUE()
)
ELSE IF Register(PC)==&address_bp_b
(
&bp_b_first=TRUE()
)
)
IF &bp_a_first
(
PRINT "Breakpoint A was hit first"
)
ELSE IF &bp_b_first
(
PRINT "Breakpoint B was hit first"
)