commUnit

A collection of common code used in (m)unit tests.
https://gitlab.com/hxgrounds/commUnit

To install, run:

haxelib install commUnit 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

CommUnit library

A collection of common code used in (m)unit tests.


Supported features

  • munit - communit.munit.CommonTestMain

    - Allows to eliminate the TestMain in the project;
    
    • communit.munit.reporter.JUnitReportWriter - Fixes the junit reporter for nodejs;

Haxe targets support

  • [x] js (node)
  • [x] neko
  • [x] python
  • [x] java
  • [x] cpp
  • [x] csharp - Tested with mono
  • [+-] lua - Asynchronous tests failing
  • [ ] swf, as3, js - Tests failing (server not found)
  • [ ] php - Untested
  • [ ] haxelink - Untested

How to Use

CommonTestMain
  • Set -main communit.munit.CommonTestMain in the test hxml file;
  • Or extends CommonTestMain with a subclass
JunitReportWriter

Included automatically by CommonTestMain.

Optionally, include this snippet in your TestMain:

    var runner:TestRunner = new TestRunner(client);
    ...
    var writer = new communit.munit.reporter.JUnitReportWriter(reportPath);
    writer.clearDirectory();
    runner.addResultClient(writer);

Warning: This reporter works only in sys targets or in nodejs.


Development

Requirements

Build and test

  • Run: lix install to install requirements
  • Run munit to test and build: - lix run munit test -<language> - Example:

    - `lix run munit test -js`
    - `lix run munit test -python`
    - ...
    

License

This work is licensed under the LGPL version 3 modified to restrict the use in AI training datasets, based on these non-ai-licenses by Aleksandar Prokopec.

In summary, this library may be used in any project, except for training AI models. However internal changes should be released under the same license.

Contributors
hxgrounds
Version
0.1.0
Published
1 year ago
Dependencies
License
LGPL

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub