CPE 101: Fundamentals of Computer Science I
Program 2 materials

Executables

If the executables don't work, try

$ chmod u+x moon-alex
or
$ chmod u+x moon-alex-unix1
If the executables do not work after that, report the problem to me.

Tests

Use input redirection to run the tests. E.g., if the name of your program is moon, then you can test your program as follows:

 $ moon < moon-test01

Scripts

These are simple test scripts that run your program, or instructor's program on the test cases. moon-test.csh compiles your code and runs it on the ten tests. moon-test-alex.csh runs moon-alex on the ten tests. To make the scripts executable, enter the following commands:

$chmod u+x moon-test.csh
$chmod u+x moon-test-alex.csh

To compare the results, you can use the following set of commands.

$ moon-test.csh > myResults.out
$ moon-test-alex.csh > alexResults.out
$ diff myResults.out alexResults.out

If everything worked correctly, the diff command will show you only the differences in one line per test (name of the program author).


February 6, 2012 dekhtyar at calpoly.edu