Move mjsunit.js to system module directory.

This commit is contained in:
Ryan Dahl
2009-09-20 18:19:33 +02:00
parent 7ddf1f569a
commit 4b8f503fac
37 changed files with 53 additions and 46 deletions

13
test/mjsunit/common.js Normal file
View File

@@ -0,0 +1,13 @@
exports.testDir = node.path.dirname(__filename);
exports.fixturesDir = node.path.join(exports.testDir, "fixtures");
exports.libDir = node.path.join(exports.testDir, "../../lib");
node.libraryPaths.unshift(exports.libDir);
var mjsunit = require("/mjsunit.js");
// Copy mjsunit namespace out
for (var prop in mjsunit) {
if (mjsunit.hasOwnProperty(prop)) exports[prop] = mjsunit[prop];
}

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var a = [116,101,115,116,32,206,163,207,131,207,128,206,177,32,226,161,140,226,160, 129,226,160,167,226,160,145];
var s = node.encodeUtf8(a);

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var e = new node.EventEmitter();

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
success_count = 0;
error_count = 0;

View File

@@ -1,9 +1,7 @@
include("mjsunit.js");
include("common.js");
var got_error = false;
var dirname = node.path.dirname(__filename);
var fixtures = node.path.join(dirname, "fixtures");
var filename = node.path.join(fixtures, "does_not_exist.txt");
var filename = node.path.join(fixturesDir, "does_not_exist.txt");
var promise = node.fs.cat(filename, "raw");
promise.addCallback(function (content) {
@@ -17,5 +15,6 @@ promise.addErrback(function () {
});
process.addListener("exit", function () {
puts("done");
assertTrue(got_error);
});

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var got_error = false;
var success_count = 0;

View File

@@ -1,8 +1,6 @@
include("mjsunit.js");
include("common.js");
var dirname = node.path.dirname(__filename);
var fixtures = node.path.join(dirname, "fixtures");
var path = node.path.join(fixtures, "write.txt");
var path = node.path.join(fixturesDir, "write.txt");
var expected = "hello";
var found;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 8888;
var body = "exports.A = function() { return 'A';}";

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 8888;
var body1_s = "1111111111111111";

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var PORT = 18032;
var sent_body = "";

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
// Make sure no exceptions are thrown when receiving malformed HTTP
// requests.

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var PROXY_PORT = 8869;
var BACKEND_PORT = 8870;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var port = 8222;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 8888;
var responses_sent = 0;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var dirname = node.path.dirname(__filename);
var fixtures = node.path.join(dirname, "fixtures");

View File

@@ -1,5 +1,5 @@
node.debug("load test-module-loading.js");
include("mjsunit.js");
include("common.js");
var a = require("fixtures/a.js");
var d = require("fixtures/b/d.js");
var d2 = require("fixtures/b/d.js");

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 8888;
puts("hello world");

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var pwd_called = false;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var exit_status = -1;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var cat = node.createChildProcess("cat");

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var N = 40;
var finished = false;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var p1_done = false;
var p1 = new node.Promise();

View File

@@ -1,13 +1,9 @@
include("mjsunit.js");
var dirname = node.path.dirname(__filename);
var fixtures = node.path.join(dirname, "fixtures");
include("common.js");
var got_error = false;
var promise = node.fs.readdir(fixtures);
puts("readdir " + fixtures);
var promise = node.fs.readdir(fixturesDir);
puts("readdir " + fixturesDir);
promise.addCallback(function (files) {
p(files);

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
// settings
var port = 20743;
var bytes = 1024*40;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var tests_run = 0;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var tests_run = 0;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 23123;
var echoServer = node.tcp.createServer(function (connection) {

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 23123;
binaryString = "";

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var N = 50;
var port = 8921;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 20444;
N = 30*1024; // 500kb

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
PORT = 20443;
N = 200;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
port = 9992;
exchanges = 0;
starttime = null;

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
var WINDOW = 800; // why is does this need to be so big?

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
// üäö

View File

@@ -1,4 +1,4 @@
include("mjsunit.js");
include("common.js");
function timer (t) {
var promise = new node.Promise();

View File

@@ -326,3 +326,4 @@ def build(bld):
""");
bld.install_files('${PREFIX}/share/man/man1/', 'doc/node.1');
bld.install_files('${PREFIX}/bin/', 'node-repl', chmod=0755);
bld.install_files('${PREFIX}/lib/node_libraries/', 'lib/*.js');