jeudi 4 février 2016

How can I use Unix testing with C programming

Just recently my professor posted a script for testing. I am unsure how exactly it works and how I can use it to my advantage. Would I need to know what the correct output would be? If so, why would I go through the trouble of making files with correct outputs when I could just check the program manually? (This seems slow) For example, if I have a program that takes an input and output file in command line, how could I test it using this way?

The script was simple:

Create a file:

 a.out < input_1 > myoutput_1
 diff output_1 myoutput_1

Assign Exectuable permission:

 chmod +x myscript

Aucun commentaire:

Enregistrer un commentaire