Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is it possible to run unit test while a debug session is already open in Wolfram Workbench 2.0?

A typical use case follows: I have a debug in Workbench session open. enter image description here

I evaluate some cells in a sample Notebook. Find some bugs, fix them and write the unit test. Now I would like to run the unit tests.

enter image description here

But Workbench says enter image description here

If I terminate the Mathematica session, than the kernel state is lost and I have to re-evaluate all the notebook cells.

share|improve this question
    
The workbench is based on an older version of the MUnit package which was available as a standalone Mathematica package before there was the workbench and which you might be able to use in an extra session as Akater suggested for his package. You can still find it deep in the directory tree of the workbench/eclipse installation (put a Print[$Path] in a test and run it). I have never checked if that MUnit package still works without the workbench but it would be the first place to look at. Maybe you'll find documentation for the older package somewhere to start off... –  Albert Retey May 17 at 8:41

1 Answer 1

I had written a small package allowing to perform unit testing independently of Workbench, while also in consistency with Workbench .mt test files

It looks like this:

Simple Unit Testing

Warning: I'm not sure if Workbench uses the same .mt format. It's certainly similar but I'd appreciate comments on that. (An example of .mt file is included in the package. It's not in repository directly, however, — it gets generated by symbol QuickExampleInstall defined in the package)

By means of properly managed CellTags in notebooks, it is possible to run tests associated with specific notebook just by executing test symbol anywhere in it. This functionality, however, is not present in the package I link to, but it's not difficult to add. It may appear there in future but I happen to be losing interest in unit testing, so it probably depends on feedback.

(If this is not what you want, and you believe this is completely useless, please tell me. I don't really understand unit testing.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.