Boost unit test with Sikuli

Asked by amy cheng

I am new to Sikuli and right now I try to use Boost Unit Test and Sikuli for our GUI automated testing.

In my boost unit test code, I could use
BOOST_REQUIRE( -1 != _wspawnv( 0, batch_path.c_str(), my_args)); (wspawnv is for creating a new process for batch file)

Batch_path is a batch file which execute Java -jar Sikuli_script.jar myScript.sikuli.

In myScript.sikuli file, I have something like
Assert Exists( picture).

So my question is, is anyway to get return code from command: Java -jar Sikuli_script.jar myScript.sikuli.
 if Assert fail in script?

Or is there other solution to achive passing assert result in Sikuli to Boost unit test file?

thanks a lot!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

use instead of assert exists():

if not exists(picture): exit(1)
else: exit(0)

and check the return code in the calling environment.

Assert fail will abort the script with an assertion exception.
I do not know, wether you can handle this situation in your environment.

Revision history for this message
amy cheng (cheng-yue) said :
#2

Thanks RaiMan, that solved my question.