| 1 |
define(["doh/runner", "require", "dojo/_base/config"], function(doh, require, config){ |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
doh.debug= console.log; |
| 11 |
doh.error= console.log; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
var oldReport = doh._report; |
| 16 |
doh._report = function(){ |
| 17 |
oldReport.apply(doh, arguments); |
| 18 |
if(this._failureCount > 0 || this._errorCount > 0){ |
| 19 |
process.exit(1); |
| 20 |
} |
| 21 |
}; |
| 22 |
|
| 23 |
console.log("\n"+doh._line); |
| 24 |
console.log("The Dojo Unit Test Harness, $Rev: 64998be $"); |
| 25 |
console.log("Copyright (c) 2018, The JS Foundation, All Rights Reserved"); |
| 26 |
console.log("Running with node.js"); |
| 27 |
for (var tests= [], args= config["commandLineArgs"], i= 0, arg; i<args.length; i++) { |
| 28 |
arg= args[i]; |
| 29 |
if (arg.length==2 && arg[0]=="test") { |
| 30 |
var test= arg[1]; |
| 31 |
console.log("loading test " + test); |
| 32 |
tests.push(test); |
| 33 |
} |
| 34 |
} |
| 35 |
console.log(doh._line, "\n"); |
| 36 |
|
| 37 |
require(tests, function() { |
| 38 |
doh.run(); |
| 39 |
}); |
| 40 |
}); |