Skip to main content
1 of 7
Caleb
  • 146
  • 5

You could test the output using GNU-Make. In your Makefile:

.ONESHELL:
SHELL = bash

test:
    diff <(./test/program1 <args>) ./tests/expected_output1.json
    diff <(./test/program2 <args>) ./tests/expected_output2.json

Then make test should pass or fail depending on whether the programs gave exactly the output they were expected too or not.

Caleb
  • 146
  • 5