Hello Brian,
> After a very brief conversation with giszmo3 I decided I would try tackling
> adding unit testing to Glob2. I started with libusl but quickly ran into a
> problem, USL provides no method of receiving the return value of a script.
> The value is dumped to cout but not saved for later. In order to test for
> the proper execution of scripts, it would be nice to know that a script
> returns (what the result of executing the last line is). I therefore made
> this small (2 additional lines) patch for intrepreter.cpp and intrepreter.h
> so that after USL step()s through a thread until it's state is state:STOP it
> saves the return value. After asking on irc i was told that this would be a
> good place to ask for this small diff to be committed (the diff is
> attached).
It's great to see you playing with usl!
Your patch seems right, except that you have to make sure that the
return value is not garbage collected: in Thread::markForGC(), call
returnValue->markForGC() if returnValue != 0.
I invented the language and implemented it with Steph, feel free to
ask questions here, as we don't hang much on IRC.
> On another subject, after a little thought I decided to use Boost:Test as
> the testing framework. Your wiki says you don't want any extra dependencies
> but in your mailing lists there have been a few comments to the effect of if
> something makes programming simpler you'll accept it, and I believe using
> Boost:Test is much easier and faster than implementing your own library. You
> probably allready have it installed considering you use Boost:Thread. Any
> feedback on this choice would be greatly appreciated.
Since it's for unit testing, you can make it optional. The tests would
be compiled and run at build-time only if boost:test is available.
Martin