I'm a beginner at shell scripts and i want to build a suite of tests so that all of the tests that have been executed on my program in the past can be executed on it again to check against bugs in a program.
So basically the shell script runs a program with given inputs and compares the output with some expected output.
I want the shell script to execute all tests instead of typing a command like this every time...
./this_program < input-1 > actual-output-1
diff actual-output-1 expected-output-1
Im thinking of using loops to interate over each case of a lot of inputs (input-1, input-2,...) and a lot of expected outputs (expected-output-1, expected-output-2,...) and I want it to be able to take the name of the program to invoke, the number of tests, and the directory that the tests they are in so i can test any program easily......I just don't know how to start the actual coding and the structure of it and use the name of the program etc..
Can anyone please help???