Contents:

Introduction

You turn in your assignment by committing to your SVN repository. While this is sufficient if all is well, we strongly recommend you then validate your submission to avoid drastic problems where you do not submit your homework correctly.

validate

Validating your code checks it for common errors, such as the code you checked in not compiling correctly with the compiler used for grading. Such errors could prevent you from receiving credit for your code, so you should always validate your assignment before you complete it. However, validation is not guaranteed to catch all errors in your code.

You should validate your assignment by running ant validate on attu (and making sure that it completes successfully!) by running the commands below.

You can log in to attu via SSH from any machine. (Even if you are working on an Allen Center Linux machine you still need to SSH into attu.)

cd ~/workspace331/cse331/src/hwN/
ant validate

or

cd ~/cse331/src/hwN/
ant validate

You need to select the correct version depending on where you have checked out your copy of your Subversion repository. If you have not yet checked out your repository on a CSE Linux machine (say, because you work on Windows or at home), then you must first check out your repository using the command line. Note that if you check out your working copy in the location suggested there, the path to your project (as listed in the directions above and in the ouput below) will not include the workspace331/ directory.

What does this do?

This checks out a fresh copy of your code (to a temporary directory) and ensures that your implementation:

What is the result?

If validation was successful, you should see output that looks something like:


Buildfile: /homes/iws/username/workspace331/cse331/src/hw1/build.xml

validate:
     [echo] Validate checks out a fresh copy of the hw, checks for the
     [echo]       presence of required files, and runs all your tests to make sure
     [echo]       they pass.  This target can only run on the attu IWS machine.
     [echo]
     [echo]       Note: the test reports will be generated under the scratch
     [echo]       directory the validate target creates.
     [echo]
   [delete] Deleting directory /homes/iws/username/workspace331/cse331/scratch
    [mkdir] Created dir: /homes/iws/username/workspace331/cse331/scratch
     [echo] /projects/instr/13sp/cse331/username/workspace331/REPOS
     [exec] A    cse331
     [exec] A    cse331/.classpath
     
     ...
     
     [exec] BUILD SUCCESSFUL
     [exec] Total time: 2 seconds
   [delete] Deleting directory /homes/iws/username/workspace331/cse331/scratch

If there is an error, the validate script should provide some information about what is wrong:


Buildfile: /homes/iws/username/workspace331/cse331/src/hw1/build.xml

validate:
     [echo] Validate checks out a fresh copy of the hw, checks for the
     [echo]       presence of required files, and runs all your tests to make sure
     [echo]       they pass.  This target can only run on the attu IWS machine.
     [echo]
     [echo]       Note: the test reports will be generated under the scratch
     [echo]       directory the validate target creates.
     [echo]
     
     ...
     
     [exec] cleancopy:
     [exec]      [echo] Hw directory: /homes/iws/username/workspace331/cse331/scratch/cse331/src/hw1
     [exec]
     [exec] BUILD FAILED
     [exec] /homes/iws/username/workspace331/cse331/scratch/cse331/src/common.xml:106: The following error occurred while executing this line:
     [exec] /homes/iws/username/workspace331/cse331/scratch/cse331/src/common.xml:121: Could not find required file: answers/hw1_answers.pdf
     [exec]
     [exec] Total time: 1 second
     [exec]
     [exec] cleancopy.check:

BUILD FAILED
/homes/iws/username/workspace331/cse331/src/common.xml:160: exec returned: 1



This error would indicate that a required file, answers/hw1_answers.pdf is missing. Make sure you've committed this file to SVN.

If the validate output indicates errors, you should fix them before the deadline, or you will lose points on your assignment. If validate failed because the public test suite failed, you can view a summary of the JUnit failures in your YourWorkspaceDirectory/scratch/cse331/src/hwN/test/reports directory.

Important: be aware that the validation script tests your code against your own test suite. Although by default we populate hwN.test.SpecificationTests with the public test suite, it is your responsibility to retain those tests in hwN.test.SpecificationTests if you want the validatation script to check your code against the public tests.

Why does this have to run on attu from the command line?

Most ant targets that the staff supplies should work both in the Allen Center software labs and on your home computer, but ant validate only works on attu. This is because we grade your solutions on attu, so it is important to verify that your code compiles and runs correctly in exactly that environment.

Eclipse's integrated Ant support does not handle the ant validate target well. Even if you use Eclipse as your development environment, you should validate on the command line as shown above.