::Runtime -- Run a TestML Function
The TestML Code and Data get compiled into a Function, and the Function
is run by this Runtime class. Typically data is manipulated by Bridge
functions, and at some point Assertions are made. The assertions are the
things that call Test::More::is and Test::More::ok.
::Compiler -- Turn a TestML document into a runnable TestML Function.
A TestML "document" is comprised of 3 main parts: Meta, Code, Data. This
information often is in a single TestML (.tml) file or string, but it
doesn't need to be. The information can come from anywhere and be in any
form that is supported; it just must all be present when it is needed.
The Meta information must be known first. It dictates where the Code and
Data come from, and in what format they are. Also the Code and Data
formats depend on the TestML API Version that is supplied. Before the
Code and Data can be compiled, a Version must be supplied (no default)
and then the compiler must support that Version. This allows TestML to
change over time with no confusion.
The compile function returns a Function object, which in turn contains
an array of Statements and an array of Data Blocks. This function is the
run by the Runtime object.
A Function is just an array of "executable" statements that are
proceseded in order. Some of the statements maybe be function
declarations and function calls. The Compiler produces a top level scope
function, with a Data set, and a Namespace for variables.
All functions are anonymous, but they can be assigned to variables, and
then you can call that variable name.