Skip to main content

Scrut

CLI Testing Made Easy

Scrut is an integration / end-to-end testing framework for CLIs with a concise syntax that makes writing and maintaining tests easy.

Write a test

tests.md
# Scrut tests are Markdown files

Documented tests for the win.

## Hello World

```scrut
$ echo "Hello World"
Hello World
```

## Failing World

```scrut
$ echo "Failing World"
Hello World
```

Run a test

Terminal
$ scrut test /tmp/test.md
🔎 Found 1 test document(s)
❌ /tmp/test.md: 1 out of 2 tests failed

// =========================================================
// @ /tmp/test.md:15
// ---------------------------------------------------------
// # Failing World
// ---------------------------------------------------------
// $ echo "Failing World"
// =========================================================

1 | - Hello World
1 | + Failing World


Result: 1 document(s) with 2 testcase(s): 1 succeeded, 1 failed and 0 skipped

Easy to Use

Scrut was designed to be simple and straightforward. If you know how to execute your CLI on a shell and you know how to write Markdown then you already know how to write tests for your CLI in Scrut.

Any size fits

Scrut is simple, yet powerful enough to handle any size CLI. From a simple bash script to a complex Java / Rust / C++ / ... binary with many dependencies. Scrut can handle it all.

Maintenance is Life

Do your future self (and any other future maintainer) a big favor and document the intended behavior of your CLI in the form of test-cases in easily readable Markdown test-files.