How to Test 112 Assignments Automatically


Starting with the p3 assignment, I will post a bash script (a program that can be executed by the bash shell) for automatically testing your program.

This script uses the same method you used in p1 & p2, so it is helpful if you understand how it works.

The script is called: run_all_tests

This script must be placed in the directory that contains your program.  There must also be a subdirectory called tests that contains all of the sample tests.

I have create a tape archive file (.tar) that contains both the run_all_tests script and the tests directory.  Here are the stps for using it:

This example is for p3.  Replace the 3 with the current assignment number.

(1) Copy the file p3_tests.tar from the tests/p3 directory to the directory containing your program.
    If you are working on a department machine you can use cp (don't forget
    the "." at the end of this command):

        $ cp ~tyson/112/tests/p3/p3_tests.tar .

    If you are working on your own machine you can download this file using
    a web browser, scp or sftp.

(2) Expand the tar (tape archive) file (works the same on Linux and Cygwin)

        $ tar -xvf p3_tests.tar

(3) Run the bash script followed by the name of the executable:

        $ run_all_tests bill

    If this does not work, try the following

        $ chmod 700 run_all_tests
        $ run_all_tests bill

    If this does not work, try the following

        $ ./run_all_tests bill

    If this does not work, send me e-mail
~