How can i test a c++ program with given input test cases?
For example an input like this
23 45 78 45 12 67 23 76 56 34
34 65 78 45 74 3 98 34 23 97
I want to be able to input these numbers from a text file into a program at run-time and test expected output. I cannot input thousands of numbers by hand in a console so are there any softwares that allow these kind of testing?
This is already being used in InterviewStreet, they use given test cases and match the expected output to test a program.
–Edit–
Is there any way i can pass values from a text file into stdin ?
You could write a little bash script to run all of your tests. An individual test would look something like this: