This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Download version 1.0
Overview:
TestRunner is a simple command line tool I use to execute unit test methods, and report failures.
First, it reflects for an attribute with a name of (by default) Jitsu.Testing.UnitTestAttribute. Unlike NUnit, which references attributes defined in an external assembly, Jitsu.Testing.UnitTestAttribute must be defined in each target assembly as described here.
Then, TestRunner reflects for static, parameterless methods which exhibit that attribute -- and invokes them. To pass, a test method must simply return true. A test method may fail either by returning false, throwing an exception, or, more simply, by writing one or more messages to Console.Error.
TestRunner is designed to be easy to call from a
Visual Studio post-build step. The only command line argument required is the path of the target
assembly -- typically represented by $(TargetPath) in a VS post-build macro.
TestRunner is free software -- you're free to modify it and redistribute it however you like. Full source code is included. (It's really just a few lines of reflection code, after all.)
Requirements:
- .NET Framework v1.1
History:
- v1.0
- Initial release.
Installation:
Simply copy TestRunner.exe into your %Path%, or wherever you
like, and you're good to go.
Usage:
TestRunner.exe <assemblypath> [<attribute>]
<assemblypath> = the target assembly to test
<attribute> = the fully-qualified type name of the attribute to reflect for
(default: Jitsu.Testing.UnitTestAttribute)
If all tests pass, the return code will be zero. If one or more tests fail, the return code will be the number of failures, plus 100 (viz. 101 or greater). If no static, parameterless methods with the specified attribute are found, the return code will be 100. If some unexpected exception occurs, the return code will likely (?) be somewhere between 1 and 100.
Happy Testing!
