Verifying Results Using diff
Follow the steps below in order to verify whether your program
generates expected results for a program. In the description
below, public01.in represents the input associated with a test
and public01.output the expected output. The diff utility is
used to verify whether the correct output is generated.
- Store the output of your program in a file by executing
a.out < public01.in >! myResults
- Compare your results against the expected results by executing
diff -U 0 -b myResults public01.output
The -U 0 -b options are used by the submit server. You can also
try -Bwi.
- Make sure you remove result files (e.g., myResults above) once
you have verified your results. If you have errors in your code,
the file created via output redirection could be huge (e.g., you
have an infinite loop) what will affect the grace cluster.
Web Accessibility