CMSC 202 Testing Scripts
After grades have been emailed to students, your instructor may provide you
access to the original testing scripts used. Below are instructions for
obtaining, configuring and running those testing scripts.
Note: these examples are designed for Project 1, but simply replace the
number '1' with the most recent project number and it should work.
Configuring your GL directories
1. Create a directory at the same level as your Proj1 directory on your
local GL account (NOT inside of Proj1) named 'test-cases'
mkdir test-cases
2. Change directory into this new directory
cd test-cases
Obtaining the Testing Scripts
3. Copy the testing scripts into this new directory
cp /afs/umbc.edu/users/d/a/dana3/pub/CMSC202/p1/test-cases/* .
Running the Testing Scripts
4. Go back into your Proj1 directory...
cd ../Proj1
5. Make your Proj1
make Proj1
6. Run the p1run testing script. The script prints a "testing" message before each test - if it hangs during a test use CTRL-c to break the loop.
../test-cases/p1run
7. You can look at the p1run script for each individual test case to run
them individually, OR you can run a subset of tests by supplying a parameter
to the p1run script. So, to run tests 2 and after, add "2" as a parameter
to the p1run script.
../test-cases/p1run 2
8. To run an individual test, use (substituting the appropriate .dat and .out
files):
Proj1 < ../test-cases/p1t1.dat > p1t1.out
Interpreting the output
9. Look at the *.out files that are created in your current directory to view
the output of the tests. What the output "should" look like can be found in
the ../test-cases/*.out files. In some cases, there is no "expected output",
and in that case, you should review the project descriptions for why the
tests failed.
10. Look at the *.dat files to view what input we used to test your projects.
Feel free to run these by hand to figure out what went wrong in your project.