Code coverage report for bin/run.js

Statements: 41.38% (12 / 29)      Branches: 20% (4 / 20)      Functions: 0% (0 / 4)      Lines: 42.86% (12 / 28)      Ignored: none     

All files » bin/ » run.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53  1   1         1     1                   1 1       1                                   1 1 1 27 27        
#!/usr/bin/env node
var args = process.argv.slice(2)
 
Iif (!args.length) {
  console.error(usage())
  process.exit(1)
}
 
Iif (args.indexOf('-h') !== -1)
  return console.log(usage())
 
function usage () {
  return function () {/*
Usage:
  tap <files>
 
Executes all the files and interprets their output as TAP
formatted test result data.
*/}.toString().split('\n').slice(1, -1).join('\n')
}
 
var isExe
Iif (process.platform == "win32") {
  // On windows, there is no good way to check that a file is executable
  isExe = function isExe () { return true }
} else {
  isExe = function isExe (stat) {
    var mod = stat.mode
    var uid = stat.uid
    var gid = stat.gid
    var u = parseInt('100', 8)
    var g = parseInt('010', 8)
    var o = parseInt('001', 8)
    var ug = u | g
 
    var ret = (mod & o)
        || (mod & g) && process.getgid && gid === process.getgid()
        || (mod & u) && process.getuid && uid === process.getuid()
        || (mod & ug) && process.getuid && 0 === process.getuid()
 
    return ret
  }
}
 
var tap = require('../lib/root.js')
var fs = require('fs')
for (var i = 0; i < args.length; i++) {
  Eif (args[i].match(/\.js$/))
    tap.spawn(process.execPath, [ args[i] ])
  else if (isExe(fs.statSync(args[i])))
    tap.spawn(args[i], [])
}