in reply to Setting up tests for cat-type filter programs

If you're just reading in one input, piped, and producing one output then it seems like a simple job.

Simply store the input for each program in a text file, and the output. Then use redirection and diff.

For example you could use:

#!/bin/sh cat data/test1.in | prog1 > data/test1.tmp diff data/test1.out data/test1.tmp

That's the general idea. Pipe in the input, and redirect the output to a temporary file. Then compare that with the expected output.

Rewriting that to iterate over a list of commands and data files, and using perl is a simple enough job I'm sure.

Steve
---
steve.org.uk