#runner #jam #spec #binary #test-runner #section #input

bin+lib specjam

A tool which can spawn a binary runner to test the JAM spec

Show the crate…

4 releases

new 0.0.4 Jan 15, 2025
0.0.3 Jan 15, 2025
0.0.2 Jan 15, 2025
0.0.1 Jan 8, 2025

#25 in #jam

Download history 126/week @ 2025-01-08

126 downloads per month

GPL-3.0 license

33KB
748 lines

Specjam

A tool which can spawn binary runner to test the JAM spec.

Usage

# Install specjam from crates.io
cargo install specjam

# Spawn a binary runner
specjam spawn <my-binary>

Apart from spawn, you can run specjam --help to get the full usage.

The JAM spec test engine developed by spacejam

Usage: specjam [OPTIONS] [COMMAND]

Commands:
  dummy   Try out the dummy test runner
  input   Print the input of a test
  list    List the tests of a section
  output  Print the output of a test
  spawn   Spawn a binary runner
  spec    Prints the version of the JAM spec
  help    Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...  The verbosity level
  -h, --help        Print help
  -V, --version     Print version

Binary Runner

The binary runner must follow the following interface:

USAGE:
  <binary> [OPTIONS]

OPTIONS:
  --section <section> the name of the section
  --name <name> the name of the test
  --input <input> The file path of the input JSON

The stdout of the binary runner must be a valid JSON which matches the following schema:

{
  "output": {
    "output": "...",
    "post_state": "..."
  }
}

There are different schema for codec, pvm, trie and shuffle. you can check out the schema with specjam input <section> <name> and specjam output <section> <name>.

LICENSE

GPL-3.0

Dependencies

~3–11MB
~107K SLoC