Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
test: Disabled several unittest for node chakracore
Browse files Browse the repository at this point in the history
* Disabled several debugger test because chakracore doesn't have support yet.
* Skip `Buffer.toString()` test that verifies using v8 specific
  `kStringMaxLength` variable.
 * Because of error difference, added baselines for some test for chakra

This gets us to 29 failures which are either not implemented or bugs in chakrashim.

PR-URL: #25
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Jianchun Xu <Jianchun.Xu@microsoft.com>
  • Loading branch information
kunalspathak committed Feb 18, 2016
1 parent 47064b8 commit 83e078c
Show file tree
Hide file tree
Showing 25 changed files with 199 additions and 7 deletions.
38 changes: 38 additions & 0 deletions test/message/eval_messages.chakracore.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[eval]
SyntaxError: 'with' statements are not allowed in strict mode
at exports.runInThisContext (vm.js:*)
at Anonymous function ([eval]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
42
42
Error: hello
at Global code ([eval]:1:1)
at exports.runInThisContext (vm.js:*)
at Anonymous function ([eval]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
Error: hello
at Global code ([eval]:1:15)
at exports.runInThisContext (vm.js:*)
at Anonymous function ([eval]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
100
ReferenceError: Variable undefined in strict mode
at Global code ([eval]:1:28)
at exports.runInThisContext (vm.js:*)
at Anonymous function ([eval]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
10
10
done
File renamed without changes.
38 changes: 38 additions & 0 deletions test/message/stdin_messages.chakracore.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[stdin]
SyntaxError: 'with' statements are not allowed in strict mode
at exports.runInThisContext (vm.js:*)
at Anonymous function ([stdin]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
42
42
Error: hello
at Global code ([stdin]:*)
at exports.runInThisContext (vm.js:*)
at Anonymous function ([stdin]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
Error: hello
at Global code ([stdin]:*)
at exports.runInThisContext (vm.js:*)
at Anonymous function ([stdin]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
100
ReferenceError: Variable undefined in strict mode
at Global code ([stdin]:*)
at exports.runInThisContext (vm.js:*)
at Anonymous function ([stdin]-wrapper:*:*)
at Module.prototype._compile (module.js:*:*)
at Anonymous function (node.js:*:*)
at nextTickCallbackWith0Args (node.js:*:*)
at _tickCallback (node.js:*:*)
10
10
done
File renamed without changes.
10 changes: 10 additions & 0 deletions test/message/vm_display_syntax_error.chakracore.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ SyntaxError: Expected identifier
at Module.runMain (module.js:*)
at startup (node.js:*)
at Anonymous function (node.js:*)
SyntaxError: Expected identifier
at exports.runInThisContext (vm.js:*)
at Anonymous function (*test*message*vm_display_syntax_error.js:*)
at Module.prototype._compile (module.js:*)
at Module._extensions[.js] (module.js:*)
at Module.prototype.load (module.js:*)
at Module._load (module.js:*)
at Module.runMain (module.js:*)
at startup (node.js:*)
at Anonymous function (node.js:*)
6 changes: 3 additions & 3 deletions test/parallel/test-cli-syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ var syntaxArgs = [

// stderr should have a syntax error message
var match = c.stderr.match(common.engineSpecificMessage({
v8: /^SyntaxError: Unexpected identifier$/m,
chakracore: /^SyntaxError: Expected ';'$/m})
);
v8: /^SyntaxError: Unexpected identifier$/m,
chakracore: /^SyntaxError: Expected ';'$/m})
);
assert(match, 'stderr incorrect');

assert.equal(c.status, 1, 'code == ' + c.status);
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-debug-brk.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const common = require('../common');
const assert = require('assert');
const spawnSync = require('child_process').spawnSync;

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

const args = [`--debug-brk=${common.PORT}`, `-e`, `0`];
const proc = spawnSync(process.execPath, args, {encoding: 'utf8'});
assert(/Debugger listening on/.test(proc.stderr));
6 changes: 6 additions & 0 deletions test/parallel/test-debug-no-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

const args = [`--debug`, `--debug-port=${common.PORT}`, `--interactive`];
const proc = spawn(process.execPath, args, { stdio: 'pipe' });
proc.stdin.write(`
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-debug-port-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

const PORT_MIN = common.PORT + 1337;
const PORT_MAX = PORT_MIN + 2;

Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-debug-port-from-cmdline.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

var debugPort = common.PORT;
var args = ['--interactive', '--debug-port=' + debugPort];
var childOptions = { stdio: ['pipe', 'pipe', 'pipe', 'ipc'] };
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-debug-signal-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

var port = common.PORT + 42;
var args = ['--debug-port=' + port,
common.fixturesDir + '/clustered-server/app.js'];
Expand Down
6 changes: 4 additions & 2 deletions test/parallel/test-fs-read-buffer-tostring-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ stream.end();
stream.on('finish', common.mustCall(function() {
fd = fs.openSync(file, 'r');
fs.read(fd, kStringMaxLength + 1, 0, 'utf8', common.mustCall(function(err) {
assert.ok(err instanceof Error);
assert.strictEqual('"toString()" failed', err.message);
if (!common.isChakraEngine) {
assert.ok(err instanceof Error);
assert.strictEqual('"toString()" failed', err.message);
}
}));
}));

Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const assert = require('assert');
const path = require('path');
const child_process = require('child_process');

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

var nodeBinary = process.argv[0];

var preloadOption = function(preloads) {
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ function error_test() {
chakracore : /^SyntaxError: Invalid usage of 'eval' in strict mode/})
},
{ client: client_unix, send: '(function() { "use strict"; if (true) function f() { } })()',
expect: /^SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/ },
expect: common.engineSpecificMessage({
v8 : /^SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/,
chakracore : /^SyntaxError: Syntax error/})
},
// Named functions can be used:
{ client: client_unix, send: 'function blah() { return 1; }',
expect: prompt_unix },
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-stringbytes-external-at-max.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

const maxString = buf.toString('binary');
assert.equal(maxString.length, kStringMaxLength);
6 changes: 6 additions & 0 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const assert = require('assert');
const util = require('util');
const vm = require('vm');

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

assert.equal(util.inspect(1), '1');
assert.equal(util.inspect(false), 'false');
assert.equal(util.inspect(''), "''");
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-v8-stats.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
require('../common');
var common = require('../common');
var assert = require('assert');
var v8 = require('v8');

Expand All @@ -16,6 +16,11 @@ keys.forEach(function(key) {
assert.equal(typeof s[key], 'number');
});

// chakra doesn't expose heapSpace names, so skip
// the test for getHeapSpaceStatistics
if (common.isChakraEngine) {
return;
}

const expectedHeapSpaces = [
'new_space',
Expand Down
6 changes: 6 additions & 0 deletions test/parallel/test-vm-debug-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ var assert = require('assert');
var vm = require('vm');
var spawn = require('child_process').spawn;

if (common.isChakraEngine) {
console.log('1..0 # Skipped: This test is disabled for chakra engine ' +
'because debugger support is not implemented yet.');
return;
}

assert.throws(function() {
vm.runInDebugContext('*');
}, /SyntaxError/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

assert.throws(function() {
buf.toString('ascii');
}, /"toString\(\)" failed/);
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

assert.throws(function() {
buf.toString('base64');
}, /"toString\(\)" failed/);
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

assert.throws(function() {
buf.toString('binary');
}, /"toString\(\)" failed/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

assert.throws(function() {
buf.toString('hex');
}, /"toString\(\)" failed/);
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

assert.throws(function() {
buf.toString();
}, /"toString\(\)" failed|Array buffer allocation failed/);
Expand Down
6 changes: 6 additions & 0 deletions test/sequential/test-stringbytes-external-exceed-max-by-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

const maxString = buf.toString('utf16le');
assert.equal(maxString.length, (kStringMaxLength + 2) / 2);
6 changes: 6 additions & 0 deletions test/sequential/test-stringbytes-external-exceed-max.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
return;
}

// Skip 'toString()' check for chakra engine because it verifies limit of v8
// specific kStringMaxLength variable.
if (common.isChakraEngine) {
return;
}

assert.throws(function() {
buf.toString('utf16le');
}, /"toString\(\)" failed/);

0 comments on commit 83e078c

Please sign in to comment.