OK, so this is what I need to do:
I have a C++ program.
I have different text files, that the program uses as input files, 1 program run - 1 input file.
I have also text files with the correct output lines for each input file, 1 program run - 1 output file.
Is it possible, by using some tool, to perform an automated testing?
This tool uses my input text files and creates the output files, and then compares the output files, to the ones that I have?
Example
Files that I have:
1.in:
STR 4 8
STR a b
Q
1.out:
48
ab
ok
Files that the tool uses and runs the program:
1.in
Tool creates output file tool1.out
Tool compares 1.out to tool1.out
If they match, then the test is OK.
I guess you'll have to write an application to do that, but if you're already creating unit tests for you initial tool then testing the file is a little useless (if that makes sense).
I think, for 1.in -> tool1.out you could use a C++ program.
This C++ program wouldn't need any file access, only input a line from standard input, the conversion (STR 4 8 to 48) and print a line and this for all lines of the file which should be converted.
Lets call it ConvertFile.exe
Then you open a new text document like Yourtest.txt and write the following lines:
1 2
type 1.in | ConvertFile.exe > tool1.out
comp tool1.out 1.out
After you have typed this, close the file and rename it to Yourtest.cmd.
I know, that i could write a C+ program to do that.
But, the goal is to show, that I can use some other testing tool, that can do this automatically...
A shell script or even makefile could do this for you. The easiest way may be to have a separate file that contains your expected output and diff the result against it.