Oddly enough, it looks like you're looking for something like claft (command and filter tester). Something like this, but much more mature.
claft (for now) is just a toy that I wrote to help students with programming. The idea is to provide exercises with simple configuration files that represent the requirements of the program in terms that are reasonably understandable to humans (and declarative rather than programmatic), as well as suitable for automatic testing.
claft runs all defined tests, passing arguments and inputs to each, checking return codes and corresponding output data ( stdout ) and error messages ( stderr ) against regular expression patterns. It collects all the failures in the list and prints the entire list at the end of each package.
It does not yet execute arbitrary I / O sequence dialogs. So far, it just transfers the data and then reads all the data / errors. It also does not use timeouts and, in fact, does not even record unsuccessful execution attempts. (I really said it was just a toy, still, right?). I have also not yet implemented support for Setup, Teardown, and External Check scripts (although I have plans to do this).
The Brian proposal for a "robot structure" might be better for your needs; although a quick look at him indicates that he is much more active than I want for my purposes. (I need everything to be simple enough so that students new to programming can focus on their exercises and not spend much time creating a test assembly).
You can look at claft and use it or get your own solution there (it is licensed by BSD). Obviously, you would be happy to contribute. (It on [bitbucket] :( http://www.bitbucket.org/ ) so you can use Mercurial to clone and fork your own repository ... and send a pull request if you ever want to I looked at merging your changes back into my repo).
Then, perhaps, I misunderstand your question.
source share