source: Dev/trunk/src/client/util/doh/_rhinoRunner.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.0 KB
Line 
1define(["doh/runner", "require", "dojo/_base/config"], function(doh, require, config){
2        /*=====
3         return {
4         // summary:
5         //             Module for running DOH tests in rhino (as opposed to a browser).
6         //             Augments return value from doh/runner.
7         };
8         =====*/
9
10        doh.debug= print;
11        doh.error= print;
12
13        // Override the doh._report method to make it quit with an
14        // appropriate exit code in case of test failures.
15        var oldReport = doh._report;
16        doh._report = function(){
17                oldReport.apply(doh, arguments);
18                if(this._failureCount > 0 || this._errorCount > 0){
19                        quit(1);
20                }
21        };
22
23        print("\n"+doh._line);
24        print("The Dojo Unit Test Harness, $Rev: f5832f7 $");
25        print("Copyright (c) 2011, The Dojo Foundation, All Rights Reserved");
26        for (var tests= [], args= config["commandLineArgs"], i= 0, arg; i<args.length; i++) {
27                arg= (args[i]+"").split("=");
28                if (arg.length==2 && arg[0]=="test") {
29                        var test= arg[1];
30                        print("loading test " + test);
31                        tests.push(test);
32                }
33        }
34        print(doh._line, "\n");
35
36        require(tests, function() {
37                doh.run();
38        });
39});
Note: See TracBrowser for help on using the repository browser.