Launching the Cricket GUI Test Runner Programmatically

73 views
Skip to first unread message

Hemanand Rajamani

unread,
Apr 14, 2014, 6:03:03 AM4/14/14
to beewar...@googlegroups.com
Hi 

I currently have a wxPython GUI for doing some specific tasks of pulling some xml data  from the database to a specific file location.

I do have test classes to test various test cases to validate the xml data.

Is there a way I can launch the Cricket GUI runner on a button click from my Python Application.

Thanks in advance.

Russell Keith-Magee

unread,
Apr 14, 2014, 8:53:04 PM4/14/14
to beewar...@googlegroups.com
Hi Hemanand,

Sure - it should be possible. I can think of at least two ways:

1) subprocess.call(). Treat cricket as a complete separate program,
and just invoke it on a button press. The upside is that the cricket
process is completely isolated - there's no interaction to coordinate.
The downside is that it's completely isolated - so once you've invoked
it, it's completely standalone - you won't be able to send a refresh
call or anything like that.

2) Run the core of Cricket in a separate thread. Essentially, this
would mean starting a thread in your wxPython GUI, and running the
Tkinter loop inside that thread. At that point, you're going to have
two competing GUI systems in a single process, which might lead to
some odd visual appearance, but you will be able to send signals to
the Cricket side from your app. At the core, this is essentially just
requires wrapping the Cricket __main__ method into something that your
own code invokes.

I hope that points you in the right direction.

Yours,
Russ Magee %-)
Reply all
Reply to author
Forward
0 new messages