/MUnitExtras

Tools for creating custom tests, test cases, isolated test environments, ... build on top of Mathematica MUnit package

Primary LanguageMathematicaMIT LicenseMIT

MUnit Extras

latest release Semantic Versioning license MIT Mathematica 8.0 9.0 10.0

Features

  • Functions creating isolated test environments.
  • Tools simplifying creation of custom tests.
  • Tools for creation of reusable test cases (collections of tests).
  • Customizable automatic failure messages.
  • 11 new specialized test functions and 4 test case functions.

Compatibility

  • Mathematica versions 8.0, 9.0 or 10.0

  • MUnit versions:

    • 1.3 - version distributed with Wolfram Workbench 2.0,
    • 1.4 - version distributed with Mathematica 10.0.

Installation

Automatic installation

To install MUnitExtras package evaluate:

Get["https://raw.githubusercontent.com/jkuczm/MUnitExtras/master/BootstrapInstall.m"]

Note that this will also install dependencies: EvaluationUtilities, MessagesUtilities, OptionsUtilities, PatternUtilities, ProtectionUtilities, StringUtilities and ProjectInstaller package, if you don't have it already installed.

Manual installation

  1. Download latest released MUnitExtras.zip file.

  2. Extract downloaded MUnitExtras.zip to any directory which is on Mathematica $Path, e.g. to one obtained by evaluating FileNameJoin[{$UserBaseDirectory,"Applications"}].

  3. Install dependencies: EvaluationUtilities, MessagesUtilities, OptionsUtilities, PatternUtilities, ProtectionUtilities, StringUtilities

Initialization

To load MUnitExtras in *.mt file run with Workbenchs test runner add Needs["MUnitExtras`"] to the file.

To use MUnitExtras in Mathematica versions < 10.0 outside of Workbenchs test runner, you must find MUnit package in your Workbench installation directory and add its location to Mathematica $Path:

$Path =
    DeleteDuplicates @ Prepend[
        $Path,
        FileNameJoin["/path/to/eclipse/configuration/org.eclipse.osgi/bundles/497/1/.cp/MathematicaSourceVersioned/Head"]
    ];

Needs["MUnitExtras`"]

(change /path/to/eclipse/configuration/org.eclipse.osgi/bundles/497/1/.cp to location of MUnit on your system).

To load MUnitExtras in Mathematica version 10.0 evaluate Needs["MUnitExtras`"]

Documentation

Real documentation is currently non-existent, except for usage messages.

*.mt files in Usage directory are supposed to be a lame substitute. Look also at acceptance and unit tests for more usage examples.

Bugs and requests

If you find any bugs or have feature request please create an issue on GitHub.

Contributing

Feel free to fork and send pull requests.

If you want to use Ant scripts from this repository you will also need to install WWBCommon project.

All contributions are welcome!

License

This package is released under The MIT License.

Versioning

Releases of this package will be numbered using Semantic Versioning guidelines.