TestModule.Stop()
While TMExecuting
WScript.Sleep(200)
Wend
Sub TestModule_OnStop(reason)
TMExecuting = False
Select Case (reason)
Case 0
MsgBox "Test module was executed completely."
Case 1
MsgBox "Test module was stopped by the user."
Case 2
MsgBox "Test module was stopped by measurement stop"
End Select
End Sub
我尝试在测试模块完成后使用它来停止测试模块,并使用WHILE循环启动第二个测试模块。但是在第一个测试模块完成后,我无法启动第二个测试模块。当我在文本文件中编写执行步骤时,我得到了它的原因。
TestModule.Start()
While (Not TMStarted)
WScript.Sleep(200)
LogFile.WriteLine "Test started"
wend
While (TMExecuting)
WScript.Sleep(500)
LogFile.write("Value of TMExecuting is:" & TMExecuting)
LogFile.WriteLine "CANoe test is running"
Wend
在第一个测试模块完成后,TMExecuting 应该是假的,这是在
Sub TestModule_Onstop(reason)
TMExecuting = False
TMStarted = False
Select Case (reason)
Case 0
MsgBox "Test module was executed completely."
Case 1
MsgBox "Test module was stopped by the user."
Case 2
MsgBox "Test module was stopped by measurement stop"
End Select
LogFile.WriteLine " CANoe test is finished"
End Sub
但它不会因为第二个测试模块没有启动而变得错误。如果有人有任何解决方案,请提供帮助。 我想使用 VBScript 在单个 Canoe 配置配置中运行多个测试模块和测试环境。