1 | /*
|
2 | Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
|
3 | Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
|
4 |
|
5 | Redistribution and use in source and binary forms, with or without
|
6 | modification, are permitted provided that the following conditions are met:
|
7 |
|
8 | * Redistributions of source code must retain the above copyright
|
9 | notice, this list of conditions and the following disclaimer.
|
10 | * Redistributions in binary form must reproduce the above copyright
|
11 | notice, this list of conditions and the following disclaimer in the
|
12 | documentation and/or other materials provided with the distribution.
|
13 |
|
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
17 | ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
23 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24 | */
|
25 |
|
26 | /*jslint node:true */
|
27 |
|
28 | (function () {
|
29 | ;
|
30 |
|
31 | var child = require('child_process'),
|
32 | nodejs = '"' + process.execPath + '"',
|
33 | ret = 0,
|
34 | suites,
|
35 | index;
|
36 |
|
37 | suites = [
|
38 | 'runner',
|
39 | 'compat'
|
40 | ];
|
41 |
|
42 | function nextTest() {
|
43 | var suite = suites[index];
|
44 |
|
45 | if (index < suites.length) {
|
46 | child.exec(nodejs + ' ./test/' + suite + '.js', function (err, stdout, stderr) {
|
47 | if (stdout) {
|
48 | process.stdout.write(suite + ': ' + stdout);
|
49 | }
|
50 | if (stderr) {
|
51 | process.stderr.write(suite + ': ' + stderr);
|
52 | }
|
53 | if (err) {
|
54 | ret = err.code;
|
55 | }
|
56 | index += 1;
|
57 | nextTest();
|
58 | });
|
59 | } else {
|
60 | process.exit(ret);
|
61 | }
|
62 | }
|
63 |
|
64 | index = 0;
|
65 | nextTest();
|
66 | }());
|