-rm -rf node_modules
test: all
- $(PYTHON) tools/test.py --mode=release simple message
+ $(PYTHON) tools/test.py --mode=release message parallel sequential
$(MAKE) jslint
$(MAKE) cpplint
+test-parallel: all
+ $(PYTHON) tools/test.py --mode=release parallel -J
+
test-http1: all
- $(PYTHON) tools/test.py --mode=release --use-http1 simple message
+ $(PYTHON) tools/test.py --mode=release --use-http1 sequential parallel message
test-valgrind: all
- $(PYTHON) tools/test.py --mode=release --valgrind simple message
+ $(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message
test/gc/node_modules/weak/build/Release/weakref.node:
@if [ ! -f $(NODE_EXE) ]; then make all; fi
$(PYTHON) tools/test.py message
test-simple: all
- $(PYTHON) tools/test.py simple
+ $(PYTHON) tools/test.py parallel sequential
test-pummel: all wrk
$(PYTHON) tools/test.py pummel
var assert = require('assert');
var net = require('net');
var util = require('util');
+var common = require('../common');
var revivals = 0;
var deaths = 0;
function tryListen() {
console.log('create a server');
net.createServer()
- .listen(0)
+ .listen(common.PORT)
.on('listening', function() {
revivals++;
this.close();
});
// module path resolve bug, regression test
-child.exec(nodejs + ' --eval "require(\'./test/simple/test-cli-eval.js\')"',
+child.exec(nodejs + ' --eval "require(\'./test/parallel/test-cli-eval.js\')"',
function(status, stdout, stderr) {
assert.equal(status.code, 42);
});
var assert = require('assert');
var cluster = require('cluster')
var net = require('net');
+var common = require('../common');
var destroyed;
var success;
success = true;
});
- }).listen(0, function() {
+ }).listen(common.PORT, function() {
var port = this.address().port;
worker = cluster.fork()
var fs = require('fs'),
dgram = require('dgram'), server, client,
- server_port = 20989,
+ server_port = common.PORT,
message_to_send = 'A message to send',
timer;
var entry = common.tmpDir + '/symlink',
expected = common.tmpDir + '/cycles/root.js';
[
- [entry, '../tmp/cycles/root.js']
+ [entry, '../' + common.tmpDirName + '/cycles/root.js']
].forEach(function(t) {
try {fs.unlinkSync(t[0]);}catch (e) {}
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');
fs.mkdirSync(tmp('node-test-realpath-d2'), 0700);
try {
[
- [entry, '../tmp/node-test-realpath-d1/foo'],
- [tmp('node-test-realpath-d1'), '../tmp/node-test-realpath-d2'],
+ [entry, '../' + common.tmpDirName + '/node-test-realpath-d1/foo'],
+ [tmp('node-test-realpath-d1'),
+ '../' + common.tmpDirName + '/node-test-realpath-d2'],
[tmp('node-test-realpath-d2/foo'), '../node-test-realpath-f2'],
[tmp('node-test-realpath-f2'), fixturesAbsDir +
'/nested-index/one/realpath-c'],
[fixturesAbsDir + '/nested-index/one/realpath-c', fixturesAbsDir +
'/nested-index/two/realpath-c'],
[fixturesAbsDir + '/nested-index/two/realpath-c',
- '../../../tmp/cycles/root.js']
+ '../../../' + common.tmpDirName + '/cycles/root.js']
].forEach(function(t) {
//common.debug('setting up '+t[0]+' -> '+t[1]);
try { fs.unlinkSync(t[0]); } catch (e) {}
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var assert = require('assert'),
+ common = require('../common'),
http = require('http');
var complete;
});
-server.listen(0, function () {
+server.listen(common.PORT, function () {
console.log('listen', server.address().port);
var agent = new http.Agent({maxSockets: 1});
var server = http.createServer(function(req, res) {
request++;
res.end();
-}).listen(function() {
+}).listen(common.PORT, function() {
var options = {
agent: null,
port: this.address().port
net.createServer(function(conn) {
conn.unref();
-}).listen(8124).unref();
+}).listen(common.PORT).unref();
-net.connect(8124, 'localhost').pause();
+net.connect(common.PORT, 'localhost').pause();
setTimeout(function() {
assert.fail('expected to exit');
var closed = false;
var s = net.createServer();
-s.listen();
+s.listen(common.PORT);
s.unref();
setTimeout(function() {
assert.equal(path.extname(f), '.js');
-assert.equal(path.dirname(f).substr(-11),
- isWindows ? 'test\\simple' : 'test/simple');
+assert.equal(path.dirname(f).substr(-13),
+ isWindows ? 'test\\parallel' : 'test/parallel');
assert.equal(path.dirname('/a/b/'), '/a');
assert.equal(path.dirname('/a/b'), '/a');
assert.equal(path.dirname('/a'), '/');
tls.createServer({ key: key, cert: cert }, function(conn) {
conn.end();
this.close();
-}).listen(0, function() {
+}).listen(common.PORT, function() {
var options = { port: this.address().port, rejectUnauthorized: true };
tls.connect(options).on('error', common.mustCall(function(err) {
assert.equal(err.code, 'UNABLE_TO_VERIFY_LEAF_SIGNATURE');
// Omitting the cert or pfx option to tls.createServer() should not throw.
// AECDH-NULL-SHA is a no-authentication/no-encryption cipher and hence
// doesn't need a certificate.
-tls.createServer({ ciphers: 'AECDH-NULL-SHA' }).listen(0, function() {
+tls.createServer({ ciphers: 'AECDH-NULL-SHA' }).listen(common.PORT, function() {
this.close();
});
import testpy
def GetConfiguration(context, root):
- return testpy.SimpleTestConfiguration(context, root, 'simple')
+ return testpy.ParallelTestConfiguration(context, root, 'parallel')
common.debug('test name clashes');
// this one exists and should import the local module
-var my_path = require('./path');
+var my_path = require('../fixtures/path');
assert.ok(common.indirectInstanceOf(my_path.path_func, Function));
// this one does not exist and should throw
assert.throws(function() { require('./utils')});
'fixtures/node_modules/baz/node_modules/asdf.js': {}
}
},
- 'simple/path.js': {},
+ 'fixtures/path.js': {},
'fixtures/throws_error.js': {},
'fixtures/registerExt.test': {},
'fixtures/registerExt.hello.world': {},
--- /dev/null
+import sys, os
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+import testpy
+
+def GetConfiguration(context, root):
+ return testpy.SimpleTestConfiguration(context, root, 'sequential')
+++ /dev/null
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-var common = require('../common');
-var net = require('net');
-var assert = require('assert');
-
-var sock = new net.Socket();
-
-var server = net.createServer().listen(common.PORT, function() {
- assert(!sock.readable);
- assert(!sock.writable);
- assert.equal(sock.readyState, 'closed');
-
- sock.connect(common.PORT, function() {
- assert.equal(sock.readable, true);
- assert.equal(sock.writable, true);
- assert.equal(sock.readyState, 'open');
-
- sock.end();
- assert(!sock.writable);
- assert.equal(sock.readyState, 'readOnly');
-
- server.close();
- sock.on('close', function() {
- assert(!sock.readable);
- assert(!sock.writable);
- assert.equal(sock.readyState, 'closed');
- });
- });
-
- assert.equal(sock.readyState, 'opening');
-});
BUILT_IN_TESTS = [
- 'simple',
+ 'sequential',
+ 'parallel',
'pummel',
'message',
'internet',
if "%config%"=="Debug" set test_args=--mode=debug
if "%config%"=="Release" set test_args=--mode=release
-if "%test%"=="test" set test_args=%test_args% simple message
+if "%test%"=="test" set test_args=%test_args% sequential parallel message
if "%test%"=="test-internet" set test_args=%test_args% internet
if "%test%"=="test-pummel" set test_args=%test_args% pummel
-if "%test%"=="test-simple" set test_args=%test_args% simple
+if "%test%"=="test-simple" set test_args=%test_args% sequential parallel
if "%test%"=="test-message" set test_args=%test_args% message
if "%test%"=="test-gc" set test_args=%test_args% gc
if "%test%"=="test-all" set test_args=%test_args%