source: Dev/branches/rest-dojo-ui/client/util/doh/_nodeRunner.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 921 bytes
Line 
1define(["doh/runner", "require"], function(doh, require) {
2        doh.debug= console.log;
3        doh.error= console.log;
4
5        // Override the doh._report method to make it quit with an
6        // appropriate exit code in case of test failures.
7        var oldReport = doh._report;
8        doh._report = function(){
9                oldReport.apply(doh, arguments);
10                if(this._failureCount > 0 || this._errorCount > 0){
11                        process.exit(1);
12                }
13        };
14
15        console.log("\n"+doh._line);
16        console.log("The Dojo Unit Test Harness, $Rev: 23869 $");
17        console.log("Copyright (c) 2011, The Dojo Foundation, All Rights Reserved");
18        console.log("Running with node.js");
19        for (var tests= [], args=doh.config["commandLineArgs"], i= 0, arg; i<args.length; i++) {
20                arg= args[i];
21                if (arg.length==2 && arg[0]=="test") {
22                        var test= arg[1];
23                        console.log("loading test " + test);
24                        tests.push(test);
25                }
26        }
27        console.log(doh._line, "\n");
28
29        require(tests, function() {
30                doh.run();
31        });
32});
Note: See TracBrowser for help on using the repository browser.