Gallio and MbUnit 3.06 Released
Gallio and MbUnit version 3.06 have been released. Gallio is an automation platform providing an "open, extensible, and neutral system for .NET that provides a common object model, runtime services and tools (such as test runners) that may be leveraged by any number of test frameworks." MbUnit is a popular generative unit test framework for .NET.
MbUnit v3.0.6 includes the following improvements:
- DefaultTestCaseTimeout (Breaking Change) In MbUnit v2 and earlier versions of MbUnit v3, there was a non-configurable default timeout of 10 minutes per test fixture. Now we have a configurable default timeout of 10 minutes per test case.
- Contact Verifiers Redux (Breaking Change!)
- Xml Data Source
With v3.0.6, MbUnit helps you get the most out of your multi-core CPU. Mark any test [Parallelizable] and it will be permitted to run in parallel with other parallelizable tests in the same fixture. Fixtures can also be marked parallelizable to enable them to be run in parallel with other parallelizable fixtures. Please note that if you want all tests within a fixture to be considered parallelizable then you still need to add [Parallelizable] to each of them. (We might add a feature to set this at the fixture or assembly level later based on user feedback.) Also note that just because a test or fixture is marked parallelizable does not mean it will run in parallel with other tests in particular. For the sake of efficiency, we limit the number of active tests threads based on the configured degree of parallelism. If you want a specific number of instances of a test to run in parallel with each other, consider using [ThreadedRepeat].
The degree of parallelism setting controls the maximum number of tests that MbUnit will attempt to run in parallel with one another. By default, the degree of parallelism equals the number of CPUs you have, or 2 at a minimum.
Contract verifiers simplify the process of testing that an implementation of a common contract is correct. For example, they can help you test your custom Exception class, verify that your datatype's Equals & GetHashCode are consistent, and check IList
invariants. We originally introduced this feature in MbUnit v3.0.4, updated it in v3.0.5 and Yann Trévin has been busy making it better for v3.0.6! Instead of using custom attributes to use a contract verifier, we now use a read-only field in the test fixture. This change makes the syntax much more expressive, but you will have to update any tests written in the old style. More documentation here: Contract Verifiers Chapter in Gallio Book
The CSV data source has been very popular. Did you know you can associate metadata with CSV data rows, like expected exceptions? Just add a column with a header like "[ExpectedException]", "[Description]", or some other metadata. In v3.0.6, we now have an XML data source too.
Gallio core also contains improvements, most notably:
- One-Click Debugging Icarus can now run tests under the debugger with just one click of the "Debug" button. It will attach (or launch) the Visual Studio debugger to the test process and start the tests.
- Auto-Reload and Auto-Run
- ReSharper Integration Added support for ReSharper v4.5 beta. Added memoization to the reflection API to improve performance.
Icarus now supports automatically reloading and running all loaded tests whenever they are recompiled. In v3.0.6, these features are controlled by a Preference. In future releases we will probably make them available from the toolbar so that it is easier to switch modes on demand.
InfoQ Sep 01, 2015