Skip to content

Commit

Permalink
Defer version enforcement checks to test262-stream
Browse files Browse the repository at this point in the history
Removes legacy version validation code. This is now handled by test262-stream and should not be double handled by test262-harness
  • Loading branch information
rwaldron committed Apr 29, 2019
1 parent a9ee190 commit 3d22ae9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 2 additions & 7 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// Copyright (C) 2014, Microsoft Corporation. All rights reserved.
// This code is governed by the BSD License found in the LICENSE file.
const DEFAULT_TEST_TIMEOUT = 10000;
const ACCEPTED_TEST262_VERSIONS = /^[1-4]\./

const fs = require('fs');
const path = require('path');
Expand Down Expand Up @@ -149,12 +148,8 @@ try {
return;
}

if (acceptVersion ? acceptVersion !== test262Version :
!ACCEPTED_TEST262_VERSIONS.test(test262Version)) {

console.error(`Incompatible test262 version: ${test262Version}`);
process.exitCode = 1;
return;
if (!acceptVersion) {
acceptVersion = test262Version;
}

const stream = new TestStream(test262Dir, includesDir, acceptVersion, argv._);
Expand Down
8 changes: 2 additions & 6 deletions test/accept-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ const reporter = 'json';

tap.test('unsupported version without `acceptVersion`', assert => {
run(['test/collateral-unsupported-version/test/**/*.js'], {reporter})
.then(() => {
assert.fail('Expected command to fail, but it succeeded.');
}, () => {})
.catch(assert.fail)
.then(assert.done);
});

Expand All @@ -20,9 +18,7 @@ tap.test('supported version with matching `acceptVersion`', assert => {

tap.test('supported version with non-matching `acceptVersion`', assert => {
run(['test/collateral-supported-version/test/**/*.js', '--acceptVersion', '99.0.0'], {reporter})
.then(() => {
assert.fail('Expected command to fail, but it succeeded.');
}, () => {})
.catch(assert.fail)
.then(assert.done);
});

Expand Down

0 comments on commit 3d22ae9

Please sign in to comment.