How to Test the Second 112 Assignment  (see How to Test the Second 112 Assignment for p2)


All the assignments will be tested using the same mechanism, so it is a very good idea to understand how it works now.

I will post a set of tests for each assignment in the 112 tests directory.  You can download the test files to the directory that contains your program using a web browser, or if you are working on one of the Department computers you directly access this directory as ~tyson/112/tests.

Each test consists on a single input file (with a name like t01) and a single corresponding output file (with a name like t01.out).  If you copy these files to the directory that contains your program, you can test your program as follows:

$ chart < t01 > t01.myout
$ diff t01.myout t01.out
$
Note: if this does not work, you might have a problem with your path.

In this example I am assuming your program is named "chart" like the first assignment.

The first line runs the program chart reading from the file t01 (the "<" redirects the file t01 into standard input) and writing to file t01.myout (the ">" redirects the standard output to the file t01.myout).

The second line compares the output from your program (t01.myout) with my posted output (t01.out).  If the two files are identical you have passed test t01.

The program diff looks for differences in files.  If there are differences it prints them.  If there are no differences, it doesn't print anything.  Thus if you do the above for each test in the test directory, and diff does not print anything, you pass all of my sample tests.

However, I will use tests that I don't post to grade your program, so it is a good idea to develop some of your own tests.

If you are programming using windows, every line in your program will contain an extra hidden character (the DOS standard is different than the Linux standard).  I will only post Linux files.  However, you can convert your DOS files to Linux files using the commend dos2unix.