testParseTestFile
Extract Metadata from Test File

Description

Read a test file, converting the metadata comments and their continuation lines into elements of a named list.

Usage

testParseTestFile(file, text = readLines(file), check = TRUE,
  check.parse = check)

Arguments

file The name of the file to read.
text The contents of the file (for debugging)
check Not used now, except as a default value for check.parse
check.parse If TRUE, make sure that the non-metadata part of the file may be parsed by R.
Value
testParseTestFile(file) returns a named list with one entry for each metadata tag in the file. Metadata comments start with a line starting with "## <Tag>: " and may be continued on another line if the following line starts with "## " but does not have a "<Tag>:" immediately following it. The output value also contains a 'file' attribute that is a copy of the file argument to this function and a 'code' attribute that is a character vector containing all the non-metadata lines in the file.
Note
The spec says that metadata comment lines must be of the form "## <Tag>:", but many existing files omit the space after the doubled comment sign. testParseTestFile accepts such lines, but a space will be added when testWriteTestFile writes out the metadata comment.
Author
Bill Dunlap, TIBCO Software Inc.
References
Test Authoring Guidelines and Convention. http://emea-got-moss01.emea.tibco.com/engineering/projectsites/rosebud/Shared%20Documents/Test%20Authoring%20Guidelines%20and%20Conventions.docx
See Also
testCreateFileTemplate
Examples
  ## Not run: 
    testCreateFileTemplate("myTest.t", pacakge="myPackage")
    testParseFileTemplate("myTest.t")
  
## End(Not run)
Package assertionTest version 6.0.0-69
Package Index