Skip to content

Commit

Permalink
Allow multiple test paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bterlson committed Jul 18, 2016
1 parent 2beb952 commit 5dfaa4a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ let test262Dir = argv.test262Dir;

// Test Pipeline
const pool = agentPool(Number(argv.threads), argv.hostType, argv.hostArgs, argv.hostPath);
const paths = globber(argv._[0]);
const paths = globber(argv._);
if (!includesDir && !test262Dir) {
test262Dir = test262Finder(paths.fileEvents);
test262Dir = test262Finder(paths.fileEvents[0]);
}
const files = paths.map(pathToTestFile);
const tests = files.map(compileFile);
Expand Down
1 change: 0 additions & 1 deletion lib/findTest262.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const Path = require('path');
module.exports = findTest262Dir;
function findTest262Dir(globber) {
const set = globber.minimatch.set;
console.log(set);
let baseDir;
for (let i = 0; i < set.length; i++) {
let base = [];
Expand Down
26 changes: 16 additions & 10 deletions lib/globber.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
const glob = require('glob');
const Rx = require('rx');

function globber(g) {
function globber(paths) {
const files = new Rx.Subject();
files.fileEvents = [];

const Glob = glob.Glob;
const fileEvents = new Glob(g);
const paths = new Rx.Subject();

fileEvents.on('match', function (file) {
paths.onNext(file);
});
paths.forEach(function (path) {
const fileEvents = new Glob(path);

fileEvents.on('match', function (file) {
files.onNext(file);
});

fileEvents.on('end', function () {
files.onCompleted();
});

fileEvents.on('end', function () {
paths.onCompleted();
files.fileEvents.push(fileEvents);
})

paths.fileEvents = fileEvents;
return paths;
return files;
}

module.exports = globber;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test262-harness",
"repository": "bterlson/test262-harness",
"version": "2.0.2",
"version": "2.0.3",
"description": "Node-based harness for test262",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 5dfaa4a

Please sign in to comment.