This project is read-only.

Will there be an exe runner?

Topics: Developer Forum
May 18, 2006 at 10:26 PM
We could deliver a set of APIs and require the user to include a main in the test assembly that calls our runner. Or we could deliver a console-style runner that displays output. Which one belongs in the NUnitLite Vision?
May 19, 2006 at 12:03 AM
Including a runner that is not a full GUI runner that would target all the platforms we discussed would be very difficult. Imagine for example my Audiovox SMT5600 phone ( which does not have a command prompt, or even a full QWERTY keyboard. Even a simple console application would be very difficult to pass a parameter to (impossible? Don't know, I'll have to write a simple application to discover that).

I will say, I've already thought about the possibility of writing a NUnitLite GUI which runs on Compact Framework once we get a release done for the runner. I just don't think we can write even a console application which will target all platforms.
May 19, 2006 at 5:57 AM
As I realize I was a bit unclear in my previous post, I've thought about writing a NUnitLite CF GUI as a personal project once an initial release was complete of NUL. I've wanted a good CF project for some time now and that would be a good fit I think.

I find designing good GUIs for the limited realestate of the Smartphone a challenge, but I think a workable NUnitLite GUI could be crafted, but like a console runner I don't know if would be a good fit for this project.
May 19, 2006 at 10:53 PM
I had assumed we would not do a gui runner. I definitely meant command line. But probably the exe would have to be limited to devices of a certain size unless we provide some inter-device communication. That's the NUnit approach, of course. Maybe we should just specify that the normal nunit console (and gui?) should be able to execute NUnitLite tests - eventually.
May 19, 2006 at 11:01 PM
So how are you imagining running tests on it?
May 20, 2006 at 5:51 AM
I thought about the possibility of saying that NUnit should be able to run NUnitLite tests myself, but I've been unable to confirm that Assemblies compiled under Compact Framework can be loaded by the full Framework.

As to how I envisioned running tests... well understand I've spent little to no time in the heart of how NUnit does this but I might approach it as two classes. One which takes an assembly file name, or an assembly object in it's constructor and then presented a collection of tests and their attributes and a second class which served as the runner interface which took members of the collection of the first as it's parameter.

Then it would be up to those who would use it merely to execute a piece of code akin to :

TestCollection t = new TestCollection("myassembly.dll");
TestRunner r = new TestRunner();
// or if you wanted a single test.
// Perhaps you would then retrieve the results
// directly from the runner...
foreach (TestResult ltr in r.Results)

Or something of that kind. It should be so simple and intuitive that integrating it into whatever UI you would like is child's play.

May 20, 2006 at 5:54 PM
Your answer is a bit deeper than I was after, but interesting. :-)

I was more meaning "What will a user do to get tests to run?"

From the reply, it sounds as if they would write code, probably in the same assembly as the tests, and use some magic to get that code loaded and run on the smartphone.

It seems to me that this is the minimal requirement. Whether we have a console-like runner is a separate question.

My own view of how a console runner would work is that it would execute on the desktop and initiate the tests - either in a simulator or on the actual device - using some of the same magic that Microsoft uses.

Of course, I don't know how to do that, which is why it's magic. :-)

As far as being executable by NUnit, it would definitely need to be loaded first. So executing it in the current version may not be possible. But since NUnit is building toward executing tests under a different framework from what it uses itself, I think we could eventually do it.