mirror of https://github.com/lukechilds/node.git
arlolra
15 years ago
committed by
Ryan Dahl
97 changed files with 325 additions and 94 deletions
@ -0,0 +1 @@ |
|||||
|
prefix internet |
@ -1,5 +0,0 @@ |
|||||
process.mixin(require('./common')); |
|
||||
|
|
||||
var fixture = path.join(__dirname, "fixtures/x.txt"); |
|
||||
|
|
||||
assert.equal("xyz\n", fs.readFileSync(fixture)); |
|
@ -0,0 +1 @@ |
|||||
|
prefix pummel |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var tcp = require("tcp"), |
var tcp = require("tcp"), |
||||
sys = require("sys"), |
sys = require("sys"), |
@ -1,5 +1,5 @@ |
|||||
// This test requires the program "ab"
|
// This test requires the program "ab"
|
||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
sys = require("sys"); |
sys = require("sys"); |
||||
PORT = 8891; |
PORT = 8891; |
@ -1,10 +1,10 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var http = require("http"), |
var http = require("http"), |
||||
multipart = require("multipart"), |
multipart = require("multipart"), |
||||
sys = require("sys"), |
sys = require("sys"), |
||||
PORT = 8222, |
PORT = 8222, |
||||
fixture = require("./fixtures/multipart"), |
fixture = require("../fixtures/multipart"), |
||||
events = require("events"), |
events = require("events"), |
||||
testPart = function (expect, part) { |
testPart = function (expect, part) { |
||||
if (!expect) { |
if (!expect) { |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var N = 40; |
var N = 40; |
||||
var finished = false; |
var finished = false; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
// settings
|
// settings
|
||||
var port = 20743; |
var port = 20743; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
|
|
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
|
|
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
PORT = 20444; |
PORT = 20444; |
||||
N = 30*1024; // 500kb
|
N = 30*1024; // 500kb
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
PORT = 20443; |
PORT = 20443; |
||||
N = 200; |
N = 200; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
port = 9992; |
port = 9992; |
||||
exchanges = 0; |
exchanges = 0; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
fs=require("fs"); |
fs=require("fs"); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var WINDOW = 200; // why is does this need to be so big?
|
var WINDOW = 200; // why is does this need to be so big?
|
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var path = require("path"); |
var path = require("path"); |
||||
|
|
@ -0,0 +1,108 @@ |
|||||
|
# Copyright 2008 the V8 project authors. All rights reserved. |
||||
|
# Redistribution and use in source and binary forms, with or without |
||||
|
# modification, are permitted provided that the following conditions are |
||||
|
# met: |
||||
|
# |
||||
|
# * Redistributions of source code must retain the above copyright |
||||
|
# notice, this list of conditions and the following disclaimer. |
||||
|
# * Redistributions in binary form must reproduce the above |
||||
|
# copyright notice, this list of conditions and the following |
||||
|
# disclaimer in the documentation and/or other materials provided |
||||
|
# with the distribution. |
||||
|
# * Neither the name of Google Inc. nor the names of its |
||||
|
# contributors may be used to endorse or promote products derived |
||||
|
# from this software without specific prior written permission. |
||||
|
# |
||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
|
||||
|
import test |
||||
|
import os |
||||
|
from os.path import join, dirname, exists |
||||
|
import re |
||||
|
|
||||
|
|
||||
|
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)") |
||||
|
FILES_PATTERN = re.compile(r"//\s+Files:(.*)") |
||||
|
|
||||
|
|
||||
|
class SimpleTestCase(test.TestCase): |
||||
|
|
||||
|
def __init__(self, path, file, mode, context, config): |
||||
|
super(SimpleTestCase, self).__init__(context, path) |
||||
|
self.file = file |
||||
|
self.config = config |
||||
|
self.mode = mode |
||||
|
|
||||
|
def GetLabel(self): |
||||
|
return "%s %s" % (self.mode, self.GetName()) |
||||
|
|
||||
|
def GetName(self): |
||||
|
return self.path[-1] |
||||
|
|
||||
|
def GetCommand(self): |
||||
|
result = [self.config.context.GetVm(self.mode)] |
||||
|
source = open(self.file).read() |
||||
|
flags_match = FLAGS_PATTERN.search(source) |
||||
|
if flags_match: |
||||
|
result += flags_match.group(1).strip().split() |
||||
|
files_match = FILES_PATTERN.search(source); |
||||
|
additional_files = [] |
||||
|
if files_match: |
||||
|
additional_files += files_match.group(1).strip().split() |
||||
|
for a_file in additional_files: |
||||
|
result.append(join(dirname(self.config.root), '..', a_file)) |
||||
|
result += [self.file] |
||||
|
return result |
||||
|
|
||||
|
def GetSource(self): |
||||
|
return open(self.file).read() |
||||
|
|
||||
|
|
||||
|
class SimpleTestConfiguration(test.TestConfiguration): |
||||
|
|
||||
|
def __init__(self, context, root): |
||||
|
super(SimpleTestConfiguration, self).__init__(context, root) |
||||
|
|
||||
|
def Ls(self, path): |
||||
|
def SelectTest(name): |
||||
|
return name.startswith('test-') and name.endswith('.js') |
||||
|
return [f[:-3] for f in os.listdir(path) if SelectTest(f)] |
||||
|
|
||||
|
def ListTests(self, current_path, path, mode): |
||||
|
simple = [current_path + [t] for t in self.Ls(self.root)] |
||||
|
#simple = [current_path + ['simple', t] for t in self.Ls(join(self.root, 'simple'))] |
||||
|
#pummel = [current_path + ['pummel', t] for t in self.Ls(join(self.root, 'pummel'))] |
||||
|
#internet = [current_path + ['internet', t] for t in self.Ls(join(self.root, 'internet'))] |
||||
|
#regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'regress'))] |
||||
|
#bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))] |
||||
|
#tools = [current_path + ['tools', t] for t in self.Ls(join(self.root, 'tools'))] |
||||
|
all_tests = simple # + regress + bugs + tools |
||||
|
result = [] |
||||
|
for test in all_tests: |
||||
|
if self.Contains(path, test): |
||||
|
file_path = join(self.root, reduce(join, test[1:], "") + ".js") |
||||
|
result.append(SimpleTestCase(test, file_path, mode, self.context, self)) |
||||
|
return result |
||||
|
|
||||
|
def GetBuildRequirements(self): |
||||
|
return ['sample', 'sample=shell'] |
||||
|
|
||||
|
def GetTestStatus(self, sections, defs): |
||||
|
status_file = join(self.root, 'simple.status') |
||||
|
if exists(status_file): |
||||
|
test.ReadConfigurationInto(status_file, sections, defs) |
||||
|
|
||||
|
|
||||
|
|
||||
|
def GetConfiguration(context, root): |
||||
|
return SimpleTestConfiguration(context, root) |
@ -0,0 +1 @@ |
|||||
|
prefix simple |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var a = require('assert'); |
var a = require('assert'); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
assert.equal(14, process._byteLength("Il était tué")); |
assert.equal(14, process._byteLength("Il était tué")); |
||||
assert.equal(14, process._byteLength("Il était tué", "utf8")); |
assert.equal(14, process._byteLength("Il était tué", "utf8")); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var dirname = path.dirname(__filename); |
var dirname = path.dirname(__filename); |
||||
|
|
@ -1,7 +1,7 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
setTimeout(function () { |
setTimeout(function () { |
||||
a = require("./fixtures/a"); |
a = require("../fixtures/a"); |
||||
}, 50); |
}, 50); |
||||
|
|
||||
process.addListener("exit", function () { |
process.addListener("exit", function () { |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var count = 100; |
var count = 100; |
||||
var fs = require('fs'); |
var fs = require('fs'); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
var testTxt = path.join(fixturesDir, "x.txt"); |
var testTxt = path.join(fixturesDir, "x.txt"); |
||||
var fs = require('fs'); |
var fs = require('fs'); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var N = 100; |
var N = 100; |
||||
var j = 0; |
var j = 0; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
var events = require('events'); |
var events = require('events'); |
||||
|
|
||||
var e = new events.EventEmitter(); |
var e = new events.EventEmitter(); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
var events = require('events'); |
var events = require('events'); |
||||
|
|
||||
var callbacks_called = [ ]; |
var callbacks_called = [ ]; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var MESSAGE = 'catch me if you can'; |
var MESSAGE = 'catch me if you can'; |
||||
var caughtException = false; |
var caughtException = false; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
success_count = 0; |
success_count = 0; |
||||
error_count = 0; |
error_count = 0; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
var got_error = false; |
var got_error = false; |
||||
|
|
||||
var filename = path.join(fixturesDir, "does_not_exist.txt"); |
var filename = path.join(fixturesDir, "does_not_exist.txt"); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var got_error = false; |
var got_error = false; |
||||
var success_count = 0; |
var success_count = 0; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var got_error = false; |
var got_error = false; |
||||
var success_count = 0; |
var success_count = 0; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var completed = 0; |
var completed = 0; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var fn = path.join(fixturesDir, "write.txt"); |
var fn = path.join(fixturesDir, "write.txt"); |
||||
var expected = "hello"; |
var expected = "hello"; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
http = require("http"); |
http = require("http"); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
PORT = 8888; |
PORT = 8888; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
var http = require("http"); |
var http = require("http"); |
||||
var PORT = 8888; |
var PORT = 8888; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
url = require("url"); |
url = require("url"); |
||||
PORT = 8888; |
PORT = 8888; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
var PORT = 18032; |
var PORT = 18032; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
http = require("http"); |
http = require("http"); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
http = require("http"); |
http = require("http"); |
||||
url = require("url"); |
url = require("url"); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
url = require("url"); |
url = require("url"); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
http = require("http"); |
http = require("http"); |
||||
url = require("url"); |
url = require("url"); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
url = require("url"); |
url = require("url"); |
||||
PORT = 8888; |
PORT = 8888; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
http = require("http"); |
http = require("http"); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
http = require("http"); |
http = require("http"); |
||||
url = require("url"); |
url = require("url"); |
||||
PORT = 8888; |
PORT = 8888; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var complete = false; |
var complete = false; |
||||
var idle = new process.IdleWatcher(); |
var idle = new process.IdleWatcher(); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var r = process.memoryUsage(); |
var r = process.memoryUsage(); |
||||
puts(inspect(r)); |
puts(inspect(r)); |
@ -1,7 +1,7 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var dirname = path.dirname(__filename); |
var dirname = path.dirname(__filename); |
||||
var fixtures = path.join(dirname, "fixtures"); |
var fixtures = path.join(dirname, "../fixtures"); |
||||
var d = path.join(fixtures, "dir"); |
var d = path.join(fixtures, "dir"); |
||||
|
|
||||
var mkdir_error = false; |
var mkdir_error = false; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var complete = 0; |
var complete = 0; |
||||
|
|
@ -1,12 +1,12 @@ |
|||||
var path = require("path"); |
var path = require("path"); |
||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var f = __filename; |
var f = __filename; |
||||
|
|
||||
assert.equal(path.basename(f), "test-path.js"); |
assert.equal(path.basename(f), "test-path.js"); |
||||
assert.equal(path.basename(f, ".js"), "test-path"); |
assert.equal(path.basename(f, ".js"), "test-path"); |
||||
assert.equal(path.extname(f), ".js"); |
assert.equal(path.extname(f), ".js"); |
||||
assert.equal(path.dirname(f).substr(-13), "/test/mjsunit"); |
assert.equal(path.dirname(f).substr(-11), "test/simple"); |
||||
path.exists(f, function (y) { assert.equal(y, true) }); |
path.exists(f, function (y) { assert.equal(y, true) }); |
||||
|
|
||||
assert.equal(path.join(".", "fixtures/b", "..", "/b/c.js"), "fixtures/b/c.js"); |
assert.equal(path.join(".", "fixtures/b", "..", "/b/c.js"), "fixtures/b/c.js"); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var pwd_called = false; |
var pwd_called = false; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var exit_status = -1; |
var exit_status = -1; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var target = function() {}; |
var target = function() {}; |
||||
process.mixin(target, { |
process.mixin(target, { |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var cat = process.createChildProcess("cat"); |
var cat = process.createChildProcess("cat"); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
// test using assert
|
// test using assert
|
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var got_error = false; |
var got_error = false; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var PORT = 8889; |
var PORT = 8889; |
||||
var http = require('http'); |
var http = require('http'); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
puts("process.pid: " + process.pid); |
puts("process.pid: " + process.pid); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var sub = path.join(fixturesDir, 'echo.js'); |
var sub = path.join(fixturesDir, 'echo.js'); |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var sub = path.join(fixturesDir, 'print-chars.js'); |
var sub = path.join(fixturesDir, 'print-chars.js'); |
||||
|
|
@ -0,0 +1,5 @@ |
|||||
|
process.mixin(require('../common')); |
||||
|
|
||||
|
var fixture = path.join(__dirname, "../fixtures/x.txt"); |
||||
|
|
||||
|
assert.equal("xyz\n", fs.readFileSync(fixture)); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
process.mixin(require("sys")); |
process.mixin(require("sys")); |
||||
|
|
||||
assert.equal("0", inspect(0)); |
assert.equal("0", inspect(0)); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
PORT = 23123; |
PORT = 23123; |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
tcp = require("tcp"); |
tcp = require("tcp"); |
||||
var N = 50; |
var N = 50; |
||||
var port = 8921; |
var port = 8921; |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var mask = 0664; |
var mask = 0664; |
||||
var old = process.umask(mask); |
var old = process.umask(mask); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
var url = require("url"), |
var url = require("url"), |
||||
sys = require("sys"); |
sys = require("sys"); |
@ -1,4 +1,4 @@ |
|||||
process.mixin(require("./common")); |
process.mixin(require("../common")); |
||||
|
|
||||
// üäö
|
// üäö
|
||||
|
|
@ -0,0 +1,108 @@ |
|||||
|
# Copyright 2008 the V8 project authors. All rights reserved. |
||||
|
# Redistribution and use in source and binary forms, with or without |
||||
|
# modification, are permitted provided that the following conditions are |
||||
|
# met: |
||||
|
# |
||||
|
# * Redistributions of source code must retain the above copyright |
||||
|
# notice, this list of conditions and the following disclaimer. |
||||
|
# * Redistributions in binary form must reproduce the above |
||||
|
# copyright notice, this list of conditions and the following |
||||
|
# disclaimer in the documentation and/or other materials provided |
||||
|
# with the distribution. |
||||
|
# * Neither the name of Google Inc. nor the names of its |
||||
|
# contributors may be used to endorse or promote products derived |
||||
|
# from this software without specific prior written permission. |
||||
|
# |
||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
|
||||
|
import test |
||||
|
import os |
||||
|
from os.path import join, dirname, exists |
||||
|
import re |
||||
|
|
||||
|
|
||||
|
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)") |
||||
|
FILES_PATTERN = re.compile(r"//\s+Files:(.*)") |
||||
|
|
||||
|
|
||||
|
class SimpleTestCase(test.TestCase): |
||||
|
|
||||
|
def __init__(self, path, file, mode, context, config): |
||||
|
super(SimpleTestCase, self).__init__(context, path) |
||||
|
self.file = file |
||||
|
self.config = config |
||||
|
self.mode = mode |
||||
|
|
||||
|
def GetLabel(self): |
||||
|
return "%s %s" % (self.mode, self.GetName()) |
||||
|
|
||||
|
def GetName(self): |
||||
|
return self.path[-1] |
||||
|
|
||||
|
def GetCommand(self): |
||||
|
result = [self.config.context.GetVm(self.mode)] |
||||
|
source = open(self.file).read() |
||||
|
flags_match = FLAGS_PATTERN.search(source) |
||||
|
if flags_match: |
||||
|
result += flags_match.group(1).strip().split() |
||||
|
files_match = FILES_PATTERN.search(source); |
||||
|
additional_files = [] |
||||
|
if files_match: |
||||
|
additional_files += files_match.group(1).strip().split() |
||||
|
for a_file in additional_files: |
||||
|
result.append(join(dirname(self.config.root), '..', a_file)) |
||||
|
result += [self.file] |
||||
|
return result |
||||
|
|
||||
|
def GetSource(self): |
||||
|
return open(self.file).read() |
||||
|
|
||||
|
|
||||
|
class SimpleTestConfiguration(test.TestConfiguration): |
||||
|
|
||||
|
def __init__(self, context, root): |
||||
|
super(SimpleTestConfiguration, self).__init__(context, root) |
||||
|
|
||||
|
def Ls(self, path): |
||||
|
def SelectTest(name): |
||||
|
return name.startswith('test-') and name.endswith('.js') |
||||
|
return [f[:-3] for f in os.listdir(path) if SelectTest(f)] |
||||
|
|
||||
|
def ListTests(self, current_path, path, mode): |
||||
|
simple = [current_path + [t] for t in self.Ls(self.root)] |
||||
|
#simple = [current_path + ['simple', t] for t in self.Ls(join(self.root, 'simple'))] |
||||
|
#pummel = [current_path + ['pummel', t] for t in self.Ls(join(self.root, 'pummel'))] |
||||
|
#internet = [current_path + ['internet', t] for t in self.Ls(join(self.root, 'internet'))] |
||||
|
#regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'regress'))] |
||||
|
#bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))] |
||||
|
#tools = [current_path + ['tools', t] for t in self.Ls(join(self.root, 'tools'))] |
||||
|
all_tests = simple # + regress + bugs + tools |
||||
|
result = [] |
||||
|
for test in all_tests: |
||||
|
if self.Contains(path, test): |
||||
|
file_path = join(self.root, reduce(join, test[1:], "") + ".js") |
||||
|
result.append(SimpleTestCase(test, file_path, mode, self.context, self)) |
||||
|
return result |
||||
|
|
||||
|
def GetBuildRequirements(self): |
||||
|
return ['sample', 'sample=shell'] |
||||
|
|
||||
|
def GetTestStatus(self, sections, defs): |
||||
|
status_file = join(self.root, 'simple.status') |
||||
|
if exists(status_file): |
||||
|
test.ReadConfigurationInto(status_file, sections, defs) |
||||
|
|
||||
|
|
||||
|
|
||||
|
def GetConfiguration(context, root): |
||||
|
return SimpleTestConfiguration(context, root) |
Loading…
Reference in new issue