unittest2
Unit test framework evolved from std/unittest
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install unittest2
choosenim install unittest2
git clone https://github.com/status-im/nim-unittest2
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| unittest2 | ✓ | ✓ | ✓ | - | - | - | - | - | - | ✓ |
Source
| Repository | https://github.com/status-im/nim-unittest2 |
|---|---|
| Homepage | https://github.com/status-im/nim-unittest2 |
| Registry Source | nimble_official |
README
unittest2
unittest2 is a Nim library for writing automated tests. It provides a familiar syntax similar to the built-in unittest module but includes enhanced reporting, advanced execution modes, and first-class support for compile-time testing.
Key Features
- Clean Output: Optimized for both human readability and CI pipelines.
- Isolated Execution: Each test runs in its own procedure.
- Strict Exceptions: Fully compatible with Nim's exception tracking system.
- Tooling Integration: Generates JUnit-compatible XML reports for CI/CD workflows.
- Compile-Time Tests: Run your tests in the Nim VM during compilation to verify code logic early.
- Advanced Execution: Supports a two-phase "Collect-and-Run" model for better progress tracking and test listing.
Compatibility
unittest2 is designed to be mostly compatible with the standard library's unittest module. In many cases, you can simply replace import unittest with import unittest2 to get started.
Installing
nimble install unittest2
Or add it to your .nimble file:
requires "unittest2"
Usage
For detailed instructions and advanced patterns, see the official documentation:
You can also explore the tests and examples directories in this repository for more inspiration.
License
MIT
Credits
- Original author: Zahary Karadjov
- Initial fork author: Ștefan Talpalaru
- Current maintainer: Status R&D
- Homepage: https://github.com/status-im/nim-unittest2