PC² Validator testing

From PC2wiki
Jump to: navigation, search

This article covers using the PC² Validator for stand-alone testing.

If you are interested in using the PC² (internal) Validator with pc2 see the PC² Validator article.


Usage

There are a number of inaccuracies (and resulting bugs) in the Validator Usage

  • Under 9.1, only options 1-5 are allowed by the admin
  • Options 3, 6-10 will behave like option 1 (simple diff)
  • Options 6-10 are not implemented as stated (|Bug 117)
  • Option 3 is not implemented as stated (|Bug 468)
  • The command line example will not work
Usage: java Validator [options] <inputfile name> <outputfile name> <answerfile name> <resultfile name> <-pc2> [pc2_option] icflag

Where: 
pc2 options are: 
1 - diff
2 - ignore whitespace at start of file
3 - ignore leading whitespace on lines
4 - ignore all whitespace on lines
5 - ignore empty lines
6   2 & 3
7   2 & 4
8   2 & 5
9   3 & 5
10  4 & 5

icflag - ignore case flag during diff/compare (true or false)

options: 
  --help    this message 
  --verbose more info like EOF: line counts
  --debug   a large amount of debugging output

If a input, output or answer file is not needed/used use - (dash) for the name, for example:
java Validator - sumit.dat sumit.ans result.xml -pc2 1 true

Running the Validator

This command line will print a usage message

java -cp lib/pc2.jar:. edu.csus.ecs.pc2.validator.Validator

A proper working example for the usage would be:

java -cp lib/pc2.jar:. edu.csus.ecs.pc2.validator.Validator - sumit.dat sumit.ans result.xml -pc2 1 true