Directory Runner
BoxLang
// Run all the specs in the tests.specs directory and subdirectories
r = new testbox.system.TestBox( directory="tests.specs" )
println( r.run() )
// Run all the specs in the tests.specs directory ONLY
r = new testbox.system.TestBox(
directory={
mapping="tets.specs",
recurse=false
} )
println( r.run() )
// Run all the specs in the tests.specs directory and subdirectories using
// a custom lambda filter
r = new testbox.system.TestBox(
directory={
mapping : "tets.specs",
filter : path -> findNoCase( "test", arguments.path ) ? true : false
}) >
println( r.run() )
// Run all the specs in the tests.specs directory and subdirectories using
// a custom lambda filter and create a JSON report
r = new testbox.system.TestBox(
directory={
mapping="tets.specs",
filter : path -> findNoCase( "test", arguments.path ) ? true : false
}) >
fileWrite( 'testreports.json', r.run() )
println( "JSON report created" )CFML
Was this helpful?