c++ testing with input cases from text files -


How can I test a C ++ program with given input test cases?

For example, an input like this

  23 45 78 of 45 12 67 23 76 56 34 34 65 78 45 74 3 98 34 23 97  < / Pre> 

I want to be able to input these numbers on a runtime to a program in a program and test the expected output. I can not input thousands of numbers with hands in the console, is there any such software that allows these tests?

It is already being used, they use test cases and match the expected output to do an investigation

- Edit -

Is there any way i can pass values ​​to text in stdin ?

You can write a little bit of script to run all your tests; Will give:

  #! / Bin / bash testprog & lt; Input1.txt & gt; Output1.txt diff Expected_ output 1.txt output1.txt # Check the return code of the difference to see if the files are different?    

Comments