Skip to content
SPECIFICTION
Get listed

Hspec vs Rust libtest

Hspec

hspec.github.io

Rust libtest

doc.rust-lang.org

Side by side

FigureHspecRust libtest
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
Windows—Yes
macOS—Yes
LinuxYesYes
Plans published11
Spec score · Unit Testing Frameworks8.1 (#10)8.0 (#13)
Parallel executionSpecs can be marked for parallel execution to use multiple CPUs; the documented example links with `-threaded` and runs with `+RTS -N -RTS`.Tests run in parallel by default, and the thread count can be set with `--test-threads`.
PurposeHspec is a testing framework for Haskell.Rustc includes a built-in facility for building and running tests for a crate.

Plans

Hspec

  • HspecFree

Hspec pricing →

Rust libtest

  • Rust libtestFree

Rust libtest pricing →

In their own words

Hspec

Hspec has no write-up on Specifiction yet; its figures are above.

Visit hspec.github.io

Rust libtest

Rust libtest is Rust’s built-in test harness for compiling and running crate tests. Building with `rustc --test` links the executable to libtest; tests are free functions marked `#[test]`. Cargo’s `cargo test` handles building and running unit, integration, and documentation tests, including code samples extracted from library documentation comments. A test succeeds when it returns without an error; a panic or non-zero termination result marks failure. You can mark tests to expect a panic or to be ignored, filter by name, choose exact matches, skip matches, select ignored tests, or list tests and benchmarks without running them. Tests run in parallel by default, with the thread count configurable. The harness can capture output, display successful-test output, and format results as pretty, terse, or JSON; JSON formatting is unstable. Rust libtest is free and supports Linux, macOS, and Windows. Catching panics requires the unwind strategy; abort-strategy support is experimental. Benchmarking and custom harnesses are experimental and nightly-only.

Visit doc.rust-lang.org