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

Version Path
webruby-0.2.7 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.2.5 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.2.4 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.2.2 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.2.1 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.1.2 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.1.1 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
webruby-0.1.0 modules/emscripten/tools/node_modules/source-map/test/run-tests.js
sprockets-browserify-0.2.0 node_modules/browserify/node_modules/browser-pack/node_modules/combine-source-map/node_modules/inline-source-map/node_modules/source-map/test/run-tests.js
sprockets-browserify-0.2.0 node_modules/browserify/node_modules/module-deps/node_modules/detective/node_modules/escodegen/node_modules/source-map/test/run-tests.js
sprockets-browserify-0.2.0 node_modules/browserify/node_modules/umd/node_modules/uglify-js/node_modules/source-map/test/run-tests.js
ruby-wisp-source-0.8.0 vendor/node_modules/browserify/node_modules/umd/node_modules/uglify-js/node_modules/source-map/test/run-tests.js
ruby-wisp-source-0.8.0 vendor/node_modules/browserify/node_modules/module-deps/node_modules/detective/node_modules/escodegen/node_modules/source-map/test/run-tests.js
ruby-wisp-source-0.8.0 vendor/node_modules/browserify/node_modules/browser-pack/node_modules/combine-source-map/node_modules/inline-source-map/node_modules/source-map/test/run-tests.js
ruby-wisp-source-0.7.0 vendor/node_modules/browserify/node_modules/umd/node_modules/uglify-js/node_modules/source-map/test/run-tests.js
ruby-wisp-source-0.7.0 vendor/node_modules/browserify/node_modules/module-deps/node_modules/detective/node_modules/escodegen/node_modules/source-map/test/run-tests.js
ruby-wisp-source-0.7.0 vendor/node_modules/browserify/node_modules/browser-pack/node_modules/combine-source-map/node_modules/inline-source-map/node_modules/source-map/test/run-tests.js