dot.dot.dot.exampol
This commit is contained in:
commit
a0bc2d79de
406 changed files with 34577 additions and 0 deletions
19
node_modules/tap/bin/tap-http.js
generated
vendored
Normal file
19
node_modules/tap/bin/tap-http.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// just an example, really
|
||||
// Run with `node tap-http.js path/to/tests/`
|
||||
|
||||
var argv = process.argv.slice(2)
|
||||
, path = require("path")
|
||||
, Runner = require("../lib/tap-runner")
|
||||
|
||||
, http = require("http")
|
||||
, server = http.createServer(function (req, res) {
|
||||
// it'd be nice to return a non-200 if the tests fail, but we don't
|
||||
// know the status until it's done, so that would mean not being able
|
||||
// to pipe the output
|
||||
res.writeHead(200, {'content-type': 'text/plain'})
|
||||
new Runner(argv, null).pipe(res)
|
||||
})
|
||||
|
||||
server.listen(1337)
|
33
node_modules/tap/bin/tap-reader.js
generated
vendored
Executable file
33
node_modules/tap/bin/tap-reader.js
generated
vendored
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// read a tap stream from stdin.
|
||||
|
||||
var TapConsumer = require("../lib/tap-consumer")
|
||||
, TapProducer = require("../lib/tap-producer")
|
||||
|
||||
var tc = new TapConsumer
|
||||
, tp = new TapProducer
|
||||
|
||||
//process.stdin.pipe(tc)
|
||||
process.stdin.on("data", function (c) {
|
||||
c = c + ""
|
||||
// console.error(JSON.stringify(c).substr(0, 100))
|
||||
tc.write(c)
|
||||
})
|
||||
process.stdin.on("end", function () { tc.end() })
|
||||
process.stdin.resume()
|
||||
//tc.pipe(tp)
|
||||
tc.on("data", function (c) {
|
||||
tp.write(c)
|
||||
})
|
||||
tc.on("end", function () { tp.end() })
|
||||
|
||||
tp.on("data", function (c) {
|
||||
console.error(["output write", c])
|
||||
process.stdout.write(c)
|
||||
})
|
||||
|
||||
tp.on("end", function (er, total, ok) {
|
||||
if (er) throw er
|
||||
process.exit(total - ok)
|
||||
})
|
127
node_modules/tap/bin/tap.js
generated
vendored
Executable file
127
node_modules/tap/bin/tap.js
generated
vendored
Executable file
|
@ -0,0 +1,127 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var argv = process.argv.slice(2)
|
||||
, path = require("path")
|
||||
, Runner = require("../lib/tap-runner")
|
||||
|
||||
, nopt = require("nopt")
|
||||
|
||||
, knownOpts =
|
||||
{ cover: [path, false]
|
||||
, "cover-dir": path
|
||||
, stderr: Boolean
|
||||
, stdout: Boolean
|
||||
, diag: Boolean
|
||||
, version: Boolean
|
||||
, tap: Boolean
|
||||
, timeout: Number
|
||||
}
|
||||
|
||||
, shorthands =
|
||||
// debugging 1: show stderr
|
||||
{ d: ["--stderr"]
|
||||
// debugging 2: show stderr and tap
|
||||
, dd: ["--stderr", "--tap"]
|
||||
// debugging 3: show stderr, tap, AND always show diagnostics.
|
||||
, ddd: ["--stderr", "--tap", "--diag"]
|
||||
, e: ["--stderr"]
|
||||
, t: ["--timeout"]
|
||||
, o: ["--tap"]
|
||||
, c: ["--cover"]
|
||||
, v: ["--version"]
|
||||
, "?": ["--help"]
|
||||
, h: ["--help"]
|
||||
}
|
||||
|
||||
, defaults =
|
||||
{ cover: "./lib"
|
||||
, "cover-dir": "./coverage"
|
||||
, stderr: process.env.TAP_STDERR
|
||||
, tap: process.env.TAP
|
||||
, diag: process.env.TAP_DIAG
|
||||
, timeout: +process.env.TAP_TIMEOUT || 30
|
||||
, version: false
|
||||
, help: false }
|
||||
|
||||
, options = nopt(knownOpts, shorthands)
|
||||
|
||||
if (options.version) {
|
||||
console.log(require("../package.json").version)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
if (options.help) {
|
||||
console.log(function(){/*
|
||||
|
||||
Usage:
|
||||
tap <options> <files>
|
||||
|
||||
Run the files as tap tests, parse the output, and report the results
|
||||
|
||||
Options:
|
||||
|
||||
--stderr Print standard error output of tests to standard error.
|
||||
--tap Print raw tap output.
|
||||
--diag Print diagnostic output for passed tests, as well as failed.
|
||||
(Implies --tap)
|
||||
--timeout Maximum time to wait for a subtest, in seconds. Default: 30
|
||||
--version Print the version of node tap
|
||||
--help Print this help
|
||||
|
||||
Please report bugs! https://github.com/isaacs/node-tap/issues
|
||||
|
||||
*/}.toString().split(/\n/).slice(1, -1).join("\n"))
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
|
||||
Object.keys(defaults).forEach(function (k) {
|
||||
if (!options.hasOwnProperty(k)) options[k] = defaults[k]
|
||||
})
|
||||
|
||||
// other tests that might rely on these
|
||||
if (options.diag) process.env.TAP_DIAG = true
|
||||
if (options.tap) process.env.TAP = true
|
||||
if (options.timeout) process.env.TAP_TIMEOUT = options.timeout
|
||||
|
||||
var r = new Runner(options)
|
||||
, TapProducer = require("../lib/tap-producer")
|
||||
|
||||
if (options.tap || options.diag) {
|
||||
r.pipe(process.stdout)
|
||||
} else {
|
||||
r.on("file", function (file, results, details) {
|
||||
var s = (details.ok ? "" : "not ") + "ok "+results.name
|
||||
, n = details.pass + "/" + details.testsTotal
|
||||
, dots = new Array(Math.max(1, 60 - s.length - n.length)).join(".")
|
||||
console.log("%s %s %s", s, dots, n)
|
||||
if (details.ok) {
|
||||
if (details.skip) {
|
||||
console.log(" skipped: %s", details.skipTotal)
|
||||
}
|
||||
} else {
|
||||
// console.error(details)
|
||||
console.log(" Command: %s", results.command)
|
||||
console.log(" " + TapProducer.encode(details.list)
|
||||
.split(/\n/).join("\n "))
|
||||
}
|
||||
})
|
||||
r.on("end", function () {
|
||||
//console.log(r)
|
||||
var s = "total"
|
||||
, n = r.results.pass + "/" + r.results.testsTotal
|
||||
, dots = new Array(60 - s.length - n.length).join(".")
|
||||
, ok = r.results.ok ? "ok" : "not ok"
|
||||
console.log("%s %s %s\n\n%s", s, dots, n, ok)
|
||||
if (r.doCoverage) {
|
||||
console.error( "\nCoverage: %s\n"
|
||||
, path.resolve(r.coverageOutDir, "index.html") )
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
r.on("end", function () {
|
||||
process.exit(r.results.tests - r.results.pass)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue