metaonly module xdc.bld.Script

Model of a script

XDCscript usage meta-domain sourced in xdc/bld/Script.xdc
var Script = xdc.useModule('xdc.bld.Script');
module-wide constants & types
        obj.hasMain// if true, this script defines main() = Bool  ...
        obj.exportSrc// if false, don't add to default release = Bool  ...
per-instance config parameters
    var params = new Script.Params// Instance config-params object;
        params.name//  = String undefined;
per-instance functions
 
struct Script.Attrs

Optional attributes for a script instance

XDCscript usage meta-domain
var obj = new Script.Attrs;
 
    obj.hasMain = Bool  ...
    // if true, this script defines main()
    obj.exportSrc = Bool  ...
    // if false, don't add to default release
    obj.releases = Release.Instance[]  ...
    // releases this script is a part of
FIELDS
releases — This array contains releases that will contain the script. Thus, a single script can be part of any set of releases. Each script is always added to the package's "default release" in addition to any releases specified in the releases array.
hasMain — This script defines a main() function. This function is called after the capsule is loaded. If the script does not define main(), it must contain statements that will run script as part of loading the script.
exportSrc — Scripts are added to the default release unless this flag is set to false.
SEE
Instance Config Parameters

XDCscript usage meta-domain
var params = new Script.Params;
// Instance config-params object
    params.attrs = Script.Attrs undefined;
    // Optional attributes for this test instance
    params.name = String undefined;
    // 
config Script.attrs  // instance

Optional attributes for this test instance

XDCscript usage meta-domain
var params = new Script.Params;
  ...
params.attrs = Script.Attrs undefined;
config Script.name  // instance
XDCscript usage meta-domain
var params = new Script.Params;
  ...
params.name = String undefined;
Script.addTest()  // instance

Add specified test to script

XDCscript usage meta-domain
inst.addTest(Test.Attrs testAttrs) returns Test.Instance
ARGUMENTS
testAttrs — optional test attrs object (xdc.bld.Test.Attrs)
DETAILS
A test encapsulates a script and a set of arguments passed to the script when it is run.
Tests are run by naming the goal "<test_name>.test" on the xdc command line; <test_name> is the test's name.
Multiple tests may have the same name; in this case, it is possible to run all tests using the single goal "<test_name>.test"
RETURNS
Returns the xdc.bld.Test instance object created.
THROWS
Error exceptions are thrown for fatal errors.
SEE
generated on Tue, 24 Aug 2010 15:39:30 GMT