Sha256: 9e8a2f7cf9b1a32b31bb6ecac017dbf40040602a7b54b7f7dda7fb51f492357d
Contents?: true
Size: 1.71 KB
Versions: 17
Compression:
Stored size: 1.71 KB
Contents
#!/usr/bin/env node /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var assert = require('assert'); var fs = require('fs'); var path = require('path'); var util = require('./source-map/util'); function run(tests) { var failures = []; var total = 0; var passed = 0; for (var i = 0; i < tests.length; i++) { for (var k in tests[i].testCase) { if (/^test/.test(k)) { total++; try { tests[i].testCase[k](assert, util); passed++; process.stdout.write('.'); } catch (e) { failures.push({ name: tests[i].name + ': ' + k, error: e }); process.stdout.write('E'); } } } } process.stdout.write('\n'); console.log(passed + ' / ' + total + ' tests passed.'); failures.forEach(function (f) { console.log('================================================================================'); console.log(f.name); console.log('--------------------------------------------------------------------------------'); console.log(f.error.stack); }); return failures.length; } var code; process.stdout.on('close', function () { process.exit(code); }); function isTestFile(f) { return /^test\-.*?\.js/.test(f); } function toModule(f) { return './source-map/' + f.replace(/\.js$/, ''); } var requires = fs.readdirSync(path.join(__dirname, 'source-map')).filter(isTestFile).map(toModule); code = run(requires.map(require).map(function (mod, i) { return { name: requires[i], testCase: mod }; })); process.exit(code);
Version data entries
17 entries across 11 versions & 3 rubygems