Thanks. The code below seems to be working for me.
Another way to run tests from http, I guess, would be using the rest interface [1].
The %unit:before
annotation is interesting because it seems to allow (or can be abused) to execute multiple update operations with one "execution".
/Andy
[1] http://docs.basex.org/wiki/REST#POST_Method
[2] http://docs.basex.org/wiki/Unit_Module#.25unit:before
----------------------
(: queue async run of all tests in $dir :)
declare function local:queue-tests($dir as xs:string,$opts as map(*)){
let $q:=``[
declare variable $password external;
client:connect('localhost',
db:system()/globaloptions/port/xs:integer(.),
'admin',
$password)
! client:execute(.,'TEST "`{$dir}`"')
]``
return jobs:eval($q,
map{"password":$opts?password},
map { 'cache': true()}
)
};
local:queue-tests("C:\Users\andy\git\content-architecture\xquery\tests",
map{"password":"admin"})