testcase-x
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Testcase X

Testcase Cross Checker

NPM

Actually it is a program output cross checker.

But also generate testcases using simeple but highly flexible rules. (By testcase-gen)

Features

  • Generate testcases by simple rules.

  • Check output with customizable preprocessor.

How to Use

1. Install

npm i testcase-x

2. Run Cross Checker

const { writeFileSync, readFileSync } = require("fs");
const { join } = require("path");
const { Checker } = require("../lib");

const c = new Checker()
    .source(readFileSync(join(__dirname, "jacob.c"), "utf8"))
    .source(readFileSync(join(__dirname, "how.c"), "utf8"))
    .genTestcase(require("./testcase.js"))
    .setPreprocessor(require("./preprocessor.js"));

c.go().then((diff) => {
    writeFileSync(join(__dirname, "result.json"), JSON.stringify(diff, null, 2));
});

For More Details, See EXAMPLE.

CLI Tool

cli.png

Install CLI

npm i -g testcase-x

Use CLI

testcase-x --recipe [recipe path] --testcase [testcase path] --output [report path] --preprocessor [preprocessor path] --source [source path] [source path 2] ...
        --recipe (-r): Recipe JS File Path.
        --testcase (-t): Testcase File Path.
        --output (-o): Output File Path.
        --preprocessor (-p): Preprocessor JS File Path.
        --source (-s): Source File Path.
        --version (-V) or (-v): Show version.

Readme

Keywords

none

Package Sidebar

Install

npm i testcase-x

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

19.1 kB

Total Files

13

Last publish

Collaborators

  • jacoblincool