]>
git.r.bdr.sh - rbdr/dotfiles/blob
64a7c3a3d200d2a7ad806a4d817443ba1e6ebf0e
2 /* -*- Mode: js; js-indent-level: 2; -*- */
4 * Copyright 2011 Mozilla Foundation and contributors
5 * Licensed under the New BSD license. See LICENSE or:
6 * http://opensource.org/licenses/BSD-3-Clause
8 var assert
= require('assert');
9 var fs
= require('fs');
10 var path
= require('path');
11 var util
= require('./source-map/util');
17 for (var i
= 0; i
< tests
.length
; i
++) {
18 for (var k
in tests
[i
].testCase
) {
19 if (/^test/.test(k
)) {
22 tests
[i
].testCase
[k
](assert
, util
);
26 console
.log('FAILED ' + tests
[i
].name
+ ': ' + k
+ '!');
34 console
.log(passed
+ ' / ' + total
+ ' tests passed.');
37 return total
- passed
;
40 function isTestFile(f
) {
41 var testToRun
= process
.argv
[2];
43 ? path
.basename(testToRun
) === f
44 : /^test\-.*?\.js/.test(f
);
47 function toModule(f
) {
48 return './source-map/' + f
.replace(/\.js$/, '');
51 var requires
= fs
.readdirSync(path
.join(__dirname
, 'source-map'))
55 var code
= run(requires
.map(require
).map(function (mod
, i
) {