Skip to content

Commit

Permalink
Run tests against current node binary if hostType is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
bterlson committed Oct 21, 2016
1 parent bd95f12 commit 9e17990
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
24 changes: 23 additions & 1 deletion bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,30 @@ if (fs.existsSync(Path.join(__dirname, '../lib/reporters', argv.reporter + '.js'
let includesDir = argv.includesDir;
let test262Dir = argv.test262Dir;

// Select hostType and hostPath. hostType defaults to 'node'.
// If using default hostType, hostPath defaults to the current node executable location.
let hostType, hostPath;
if (argv.hostType) {
hostType = argv.hostType;

if (argv.hostPath) {
console.error('Missing host path. Pass --hostPath with a path to the host executable you want to test.');
process.exit(1);
}

hostPath = argv.hostPath;
} else {
hostType = 'node';

if (argv.hostPath) {
hostPath = argv.hostPath;
} else {
hostPath = process.execPath;
}
}

// Test Pipeline
const pool = agentPool(Number(argv.threads), argv.hostType, argv.hostArgs, argv.hostPath);
const pool = agentPool(Number(argv.threads), hostType, argv.hostArgs, hostPath);
const paths = globber(argv._);
if (!includesDir && !test262Dir) {
test262Dir = test262Finder(paths.fileEvents[0]);
Expand Down
1 change: 0 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const yargs = require('yargs');
const yargv = yargs
.strict()
.usage('Usage: test262-harness [options] <test-file-glob>')
.demand('hostType')
.describe('hostType', 'eshost host type (ch, d8, jsshell, chrome, firefox, etc.)')
.describe('hostPath', 'path to eshost host binary')
.describe('hostArgs', 'command-line arguments to pass to eshost host')
Expand Down

0 comments on commit 9e17990

Please sign in to comment.