Moved all spec and benchmark tests
- Moved benchmark to test/benchmark - Moved tests to test/spec - Removed individual servers - Implemented single test server - Moved server assets to test/server - Updated Gulpfile.js - Moved tools/impact to test/impact This commit move's nearly all code related to testing the PEG.js module into the test directory, and also ensures they run as they did before the move.master
parent
a1ad351c2c
commit
5a833bd982
@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
// Small server whose main purpose is to ensure that both the benchmarked code
|
||||
// and the benchmark get passed through Babel & Browserify before they are
|
||||
// served to the browser.
|
||||
|
||||
let babelify = require("babelify");
|
||||
let browserify = require("browserify");
|
||||
let express = require("express");
|
||||
let glob = require("glob");
|
||||
let logger = require("morgan");
|
||||
|
||||
let app = express();
|
||||
|
||||
app.use(logger("dev"));
|
||||
app.use(express.static(__dirname));
|
||||
app.use("/examples", express.static(`${__dirname}/../examples`));
|
||||
|
||||
app.get("/bundle.js", (req, res) => {
|
||||
let files = glob.sync(`${__dirname}/**/*.js`, {
|
||||
ignore: `${__dirname}/vendor/**/*`
|
||||
});
|
||||
|
||||
browserify(files)
|
||||
.transform(babelify, { presets: "es2015", compact: false })
|
||||
.bundle()
|
||||
.pipe(res);
|
||||
});
|
||||
|
||||
app.listen(8000, () => {
|
||||
console.log("Benchmark server running at http://localhost:8000...");
|
||||
});
|
@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
// Small server whose main purpose is to ensure that both the tested code and
|
||||
// the tests get passed through Babel & Browserify before they are served to the
|
||||
// browser.
|
||||
|
||||
let babelify = require("babelify");
|
||||
let browserify = require("browserify");
|
||||
let express = require("express");
|
||||
let glob = require("glob");
|
||||
let logger = require("morgan");
|
||||
|
||||
let app = express();
|
||||
|
||||
app.use(logger("dev"));
|
||||
app.use(express.static(__dirname));
|
||||
|
||||
app.get("/bundle.js", (req, res) => {
|
||||
let files = glob.sync(`${__dirname}/**/*.js`, {
|
||||
ignore: `${__dirname}/vendor/**/*`
|
||||
});
|
||||
|
||||
browserify(files)
|
||||
.transform(babelify, { presets: "es2015", compact: false })
|
||||
.bundle()
|
||||
.pipe(res);
|
||||
});
|
||||
|
||||
app.listen(8000, () => {
|
||||
console.log("Test server running at http://localhost:8000...");
|
||||
});
|
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>PEG.js Test Suites</title>
|
||||
<style>
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #1A0BF1;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: #9D0BF1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<h1>PEG.js Test Suites</h1>
|
||||
</p>
|
||||
• <a href="/benchmark.html">Benchmark Suite</a><br />
|
||||
• <a href="/spec.html">Spec Suite</a>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
let babelify = require("babelify");
|
||||
let browserify = require("browserify");
|
||||
let express = require("express");
|
||||
let glob = require("glob");
|
||||
let logger = require("morgan");
|
||||
|
||||
let app = express();
|
||||
|
||||
app.use(logger("dev"));
|
||||
app.use(express.static(__dirname));
|
||||
app.use("/benchmark", express.static(`${__dirname}/../benchmark`));
|
||||
app.use("/examples", express.static(`${__dirname}/../../examples`));
|
||||
|
||||
app.get("/:dir/bundle.js", (req, res) => {
|
||||
browserify(glob.sync(
|
||||
`${__dirname}/../${req.params.dir}/**/*.js`
|
||||
))
|
||||
.transform(babelify, {
|
||||
presets: "es2015",
|
||||
compact: false
|
||||
})
|
||||
.bundle()
|
||||
.pipe(res);
|
||||
});
|
||||
|
||||
app.listen(8000, () => {
|
||||
console.log("Test server running at: http://localhost:8000/");
|
||||
});
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT
|
||||
* @author Ariel Flesler
|
||||
* @version 2.1.2
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT
|
||||
* @author Ariel Flesler
|
||||
* @version 2.1.2
|
||||
*/
|
||||
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p});
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
let chai = require("chai");
|
||||
let peg = require("../../lib/peg");
|
||||
let peg = require("../../../lib/peg");
|
||||
let sinon = require("sinon");
|
||||
|
||||
let expect = chai.expect;
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
let chai = require("chai");
|
||||
let peg = require("../../lib/peg");
|
||||
let peg = require("../../../lib/peg");
|
||||
|
||||
let expect = chai.expect;
|
||||
|
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
let parser = require("../../../../lib/parser");
|
||||
let parser = require("../../../../../lib/parser");
|
||||
|
||||
module.exports = function(chai, utils) {
|
||||
let Assertion = chai.Assertion;
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
let chai = require("chai");
|
||||
let parser = require("../../lib/parser");
|
||||
let parser = require("../../../lib/parser");
|
||||
|
||||
let expect = chai.expect;
|
||||
|
Loading…
Reference in New Issue