NAME

updatefields - update field contents against patterns

SYNOPSIS

updatefields [-n] suite field=val... [file...]

OPTIONS AND ARGUMENTS

-n

Do nothing, just say what would have been done.

suite

The name of the test suite on which to operate.

file

Zero or more files in the test suite tree that you want to investigate. If no files are specified on the command line, then all files in the test suite are examined and updated as per the field specifications.

Field specifications are of the form:

fieldName=defaultValue(s)

If the field should have a default literal value added (only when the field is currently blank or missing).

fieldName=~perl expression

If the field should have its contents transformed using a perl expression in this case, the entire value of the field (minus the initial tilde) is used as a perl express that is eval'd, and the current value of the field being transformed is held in the variable $_. This means that simple patterns like s/T1/T1,T2/; will update the value, and you can also write substantially more complex expressions. Any legal perl block will work. Just remember that you are transforming $_ and that the output should ultimately be back in that variable.

For example, to ensure that the "version" field of a test suite has the value "2.1" added to every test case where that field already had a value of "2.0", you would do:

updateFields mySuite version='~s/2\.0/2.0, 2.1/'

Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.