Skip to content

Building MUnit from source

misprintt edited this page Nov 29, 2011 · 1 revision

1. Checkout source from github

Follow instructions here: [http://github.com/massiveinteractive/MassiveUnit]

2. Make sure to install mlib

haxelib install mlib

Note: if you already have munit installed then mlib will already be installed locally

MLib provides a simple framework for the MUnit build tool, as well as it's own build tool for simplifying the creation, packaging and installation of the MUnit haxelib package for testing.

3. Overview of contents:

MUnit is separated into several sub projects:

Core

This is the main unit testing framework. It contains a src and test package as well as hxml files for build and testing

Tool

This is the neko source for the build tool used with running 'haxelib run munit'

It contains the following:

  • src - neko source
  • test - unit tests (rather sparse ATM)
  • template - compile time file templates and help content used by the build tool
  • resource - runtime resources for the html print clients

Example

This contains a simple example project that can be run and tested across all supported targets

4. Compiling and testing in haxelib

Compiling MUnit

To build, test and install the munit haxelib package run the build file in the top level package

haxe build.hxml

This build file does the following

  • Generates an 'AllClasses.hx' containing references to all classes in a sub project (useful as a smoke test to ensure all code included is valid)
  • Builds both the core and tool sources
  • Compiles as runs unit tests for both sub projects
  • Packages up a haxelib.zip and installs locally

Note: If you have any problems make sure to create a 'bin' directory in the top level directory

Running tests

To just run unit tests

haxe test.hxml