What if you can test every single program you make, test Stdout, test Stderr and Status code of all your program in any language you want !
It's just what BinaryTester do !
You must have nodejs and npm installed It Works only on linux
-
For this example, I choose to test echo command, I think this command is safe but anyway we test it....
First I need to write a file (in yaml or json) to design my tests
Tests: - name: "echo" description: "Echo Test, this is an example" command: "echo 'This is an example'" testType: "refer" referCommand: "echo 'This is an example'"
Here I check if
echo 'This is an example'
is the same asecho 'This is an example'
I think it is but let's check...So let's run our favourite BinaryTester ->
./binaryTester example/ootb.yaml
Out :
Starting Tests... Test 1: echo... OK Tests Results -> Success: 1 Fail: 0 Skipped: 0 <-
Okay the echo command is the same that.... the echo command !
- Clone this repo
- Run
npm run build
to build package locally - Then you can test it in the current directory with
./bin/cli
- Help with
binaryTester -h
- Example of tests files in Examples
- Run
npm run installPack
to install package globally Then you havebinaryTester
globally in any directory you want