diff options
author | arlolra <arlolra@gmail.com> | 2010-02-25 01:36:17 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-02-25 11:41:11 -0800 |
commit | 04fac198225ae48ed7726c15609d254fddce4862 (patch) | |
tree | b09866cfed0c40d4cd3731f1d8b161e335df17e0 /test | |
parent | 9ad7539cf9c36edf4b014adb1ce979f578de0aa1 (diff) | |
download | node-new-04fac198225ae48ed7726c15609d254fddce4862.tar.gz |
Split tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/common.js (renamed from test/mjsunit/common.js) | 0 | ||||
-rw-r--r-- | test/disabled/test-cat.js (renamed from test/mjsunit/disabled/test-cat.js) | 0 | ||||
-rw-r--r-- | test/disabled/test-dns.js (renamed from test/mjsunit/disabled/test-dns.js) | 0 | ||||
-rw-r--r-- | test/disabled/test-eio-race3.js (renamed from test/mjsunit/disabled/test-eio-race3.js) | 0 | ||||
-rw-r--r-- | test/disabled/test-fs-sendfile.js (renamed from test/mjsunit/disabled/test-fs-sendfile.js) | 0 | ||||
-rw-r--r-- | test/disabled/test-http-stress.js (renamed from test/mjsunit/disabled/test-http-stress.js) | 0 | ||||
-rw-r--r-- | test/fixtures/a.js (renamed from test/mjsunit/fixtures/a.js) | 0 | ||||
-rw-r--r-- | test/fixtures/b/c.js (renamed from test/mjsunit/fixtures/b/c.js) | 0 | ||||
-rw-r--r-- | test/fixtures/b/d.js (renamed from test/mjsunit/fixtures/b/d.js) | 0 | ||||
-rw-r--r-- | test/fixtures/b/package/index.js (renamed from test/mjsunit/fixtures/b/package/index.js) | 0 | ||||
-rw-r--r-- | test/fixtures/cycles/folder/foo.js (renamed from test/mjsunit/fixtures/cycles/folder/foo.js) | 0 | ||||
-rw-r--r-- | test/fixtures/cycles/root.js (renamed from test/mjsunit/fixtures/cycles/root.js) | 0 | ||||
-rw-r--r-- | test/fixtures/echo.js (renamed from test/mjsunit/fixtures/echo.js) | 0 | ||||
-rw-r--r-- | test/fixtures/multipart.js (renamed from test/mjsunit/fixtures/multipart.js) | 0 | ||||
-rw-r--r-- | test/fixtures/nested-index/one/hello.js (renamed from test/mjsunit/fixtures/nested-index/one/hello.js) | 0 | ||||
-rw-r--r-- | test/fixtures/nested-index/one/index.js (renamed from test/mjsunit/fixtures/nested-index/one/index.js) | 0 | ||||
-rw-r--r-- | test/fixtures/nested-index/two/hello.js (renamed from test/mjsunit/fixtures/nested-index/two/hello.js) | 0 | ||||
-rw-r--r-- | test/fixtures/nested-index/two/index.js (renamed from test/mjsunit/fixtures/nested-index/two/index.js) | 0 | ||||
-rw-r--r-- | test/fixtures/print-chars.js (renamed from test/mjsunit/fixtures/print-chars.js) | 0 | ||||
-rw-r--r-- | test/fixtures/test_ca.pem (renamed from test/mjsunit/fixtures/test_ca.pem) | 0 | ||||
-rw-r--r-- | test/fixtures/test_cert.pem (renamed from test/mjsunit/fixtures/test_cert.pem) | 0 | ||||
-rw-r--r-- | test/fixtures/test_key.pem (renamed from test/mjsunit/fixtures/test_key.pem) | 0 | ||||
-rw-r--r-- | test/fixtures/throws_error.js (renamed from test/mjsunit/fixtures/throws_error.js) | 0 | ||||
-rw-r--r-- | test/fixtures/x.txt (renamed from test/mjsunit/fixtures/x.txt) | 0 | ||||
-rw-r--r-- | test/internet/internet.status | 1 | ||||
-rw-r--r-- | test/internet/testcfg.py (renamed from test/mjsunit/testcfg.py) | 21 | ||||
-rw-r--r-- | test/mjsunit/test-sync-fileread.js | 5 | ||||
-rw-r--r-- | test/pummel/pummel.status | 1 | ||||
-rw-r--r-- | test/pummel/test-http-client-reconnect-bug.js (renamed from test/mjsunit/test-http-client-reconnect-bug.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-keep-alive.js (renamed from test/mjsunit/test-keep-alive.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-multipart.js (renamed from test/mjsunit/test-multipart.js) | 4 | ||||
-rw-r--r-- | test/pummel/test-process-spawn-loop.js (renamed from test/mjsunit/test-process-spawn-loop.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-many-clients.js (renamed from test/mjsunit/test-tcp-many-clients.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-pingpong-delay.js (renamed from test/mjsunit/test-tcp-pingpong-delay.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-pingpong.js (renamed from test/mjsunit/test-tcp-pingpong.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-throttle-kernel-buffer.js (renamed from test/mjsunit/test-tcp-throttle-kernel-buffer.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-throttle.js (renamed from test/mjsunit/test-tcp-throttle.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-timeout.js (renamed from test/mjsunit/test-tcp-timeout.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-tcp-tls.js (renamed from test/mjsunit/test-tcp-tls.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-timers.js (renamed from test/mjsunit/test-timers.js) | 2 | ||||
-rw-r--r-- | test/pummel/test-watch-file.js (renamed from test/mjsunit/test-watch-file.js) | 2 | ||||
-rw-r--r-- | test/pummel/testcfg.py | 108 | ||||
-rw-r--r-- | test/simple/simple.status | 1 | ||||
-rw-r--r-- | test/simple/test-assert.js (renamed from test/mjsunit/test-assert.js) | 2 | ||||
-rw-r--r-- | test/simple/test-byte-length.js (renamed from test/mjsunit/test-byte-length.js) | 2 | ||||
-rw-r--r-- | test/simple/test-chdir.js (renamed from test/mjsunit/test-chdir.js) | 2 | ||||
-rw-r--r-- | test/simple/test-delayed-require.js (renamed from test/mjsunit/test-delayed-require.js) | 4 | ||||
-rw-r--r-- | test/simple/test-eio-race.js (renamed from test/mjsunit/test-eio-race.js) | 2 | ||||
-rw-r--r-- | test/simple/test-eio-race2.js (renamed from test/mjsunit/test-eio-race2.js) | 2 | ||||
-rw-r--r-- | test/simple/test-eio-race4.js (renamed from test/mjsunit/test-eio-race4.js) | 2 | ||||
-rw-r--r-- | test/simple/test-event-emitter-add-listeners.js (renamed from test/mjsunit/test-event-emitter-add-listeners.js) | 2 | ||||
-rw-r--r-- | test/simple/test-event-emitter-modify-in-emit.js (renamed from test/mjsunit/test-event-emitter-modify-in-emit.js) | 2 | ||||
-rw-r--r-- | test/simple/test-exception-handler.js (renamed from test/mjsunit/test-exception-handler.js) | 2 | ||||
-rw-r--r-- | test/simple/test-exec.js (renamed from test/mjsunit/test-exec.js) | 2 | ||||
-rw-r--r-- | test/simple/test-file-read-noexist.js (renamed from test/mjsunit/test-file-read-noexist.js) | 2 | ||||
-rw-r--r-- | test/simple/test-fs-chmod.js (renamed from test/mjsunit/test-fs-chmod.js) | 2 | ||||
-rw-r--r-- | test/simple/test-fs-stat.js (renamed from test/mjsunit/test-fs-stat.js) | 2 | ||||
-rw-r--r-- | test/simple/test-fs-symlink.js (renamed from test/mjsunit/test-fs-symlink.js) | 2 | ||||
-rw-r--r-- | test/simple/test-fs-write.js (renamed from test/mjsunit/test-fs-write.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-1.0.js (renamed from test/mjsunit/test-http-1.0.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-cat.js (renamed from test/mjsunit/test-http-cat.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-chunked.js (renamed from test/mjsunit/test-http-chunked.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-client-race.js (renamed from test/mjsunit/test-http-client-race.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-client-upload.js (renamed from test/mjsunit/test-http-client-upload.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-eof-on-connect.js (renamed from test/mjsunit/test-http-eof-on-connect.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-malformed-request.js (renamed from test/mjsunit/test-http-malformed-request.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-proxy.js (renamed from test/mjsunit/test-http-proxy.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-server.js (renamed from test/mjsunit/test-http-server.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-tls.js (renamed from test/mjsunit/test-http-tls.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http-wget.js (renamed from test/mjsunit/test-http-wget.js) | 2 | ||||
-rw-r--r-- | test/simple/test-http.js (renamed from test/mjsunit/test-http.js) | 2 | ||||
-rw-r--r-- | test/simple/test-idle-watcher.js (renamed from test/mjsunit/test-idle-watcher.js) | 2 | ||||
-rw-r--r-- | test/simple/test-memory-usage.js (renamed from test/mjsunit/test-memory-usage.js) | 2 | ||||
-rw-r--r-- | test/simple/test-mkdir-rmdir.js (renamed from test/mjsunit/test-mkdir-rmdir.js) | 4 | ||||
-rw-r--r-- | test/simple/test-module-loading.js (renamed from test/mjsunit/test-module-loading.js) | 26 | ||||
-rw-r--r-- | test/simple/test-next-tick.js (renamed from test/mjsunit/test-next-tick.js) | 2 | ||||
-rw-r--r-- | test/simple/test-path.js (renamed from test/mjsunit/test-path.js) | 4 | ||||
-rw-r--r-- | test/simple/test-process-buffering.js (renamed from test/mjsunit/test-process-buffering.js) | 2 | ||||
-rw-r--r-- | test/simple/test-process-kill.js (renamed from test/mjsunit/test-process-kill.js) | 2 | ||||
-rw-r--r-- | test/simple/test-process-mixin.js (renamed from test/mjsunit/test-process-mixin.js) | 2 | ||||
-rw-r--r-- | test/simple/test-process-simple.js (renamed from test/mjsunit/test-process-simple.js) | 2 | ||||
-rw-r--r-- | test/simple/test-querystring.js (renamed from test/mjsunit/test-querystring.js) | 2 | ||||
-rw-r--r-- | test/simple/test-readdir.js (renamed from test/mjsunit/test-readdir.js) | 2 | ||||
-rw-r--r-- | test/simple/test-remote-module-loading.js (renamed from test/mjsunit/test-remote-module-loading.js) | 2 | ||||
-rw-r--r-- | test/simple/test-signal-handler.js (renamed from test/mjsunit/test-signal-handler.js) | 2 | ||||
-rw-r--r-- | test/simple/test-stdio.js (renamed from test/mjsunit/test-stdio.js) | 2 | ||||
-rw-r--r-- | test/simple/test-stdout-flush.js (renamed from test/mjsunit/test-stdout-flush.js) | 2 | ||||
-rw-r--r-- | test/simple/test-sync-fileread.js | 5 | ||||
-rw-r--r-- | test/simple/test-sys.js (renamed from test/mjsunit/test-sys.js) | 2 | ||||
-rw-r--r-- | test/simple/test-tcp-binary.js (renamed from test/mjsunit/test-tcp-binary.js) | 2 | ||||
-rw-r--r-- | test/simple/test-tcp-reconnect.js (renamed from test/mjsunit/test-tcp-reconnect.js) | 2 | ||||
-rw-r--r-- | test/simple/test-umask.js (renamed from test/mjsunit/test-umask.js) | 2 | ||||
-rw-r--r-- | test/simple/test-url.js (renamed from test/mjsunit/test-url.js) | 2 | ||||
-rw-r--r-- | test/simple/test-utf8-scripts.js (renamed from test/mjsunit/test-utf8-scripts.js) | 2 | ||||
-rw-r--r-- | test/simple/testcfg.py | 108 |
95 files changed, 315 insertions, 93 deletions
diff --git a/test/mjsunit/common.js b/test/common.js index 7f2a277ff9..7f2a277ff9 100644 --- a/test/mjsunit/common.js +++ b/test/common.js diff --git a/test/mjsunit/disabled/test-cat.js b/test/disabled/test-cat.js index 2ae15beaba..2ae15beaba 100644 --- a/test/mjsunit/disabled/test-cat.js +++ b/test/disabled/test-cat.js diff --git a/test/mjsunit/disabled/test-dns.js b/test/disabled/test-dns.js index 47fa6e144c..47fa6e144c 100644 --- a/test/mjsunit/disabled/test-dns.js +++ b/test/disabled/test-dns.js diff --git a/test/mjsunit/disabled/test-eio-race3.js b/test/disabled/test-eio-race3.js index bcfc6e095d..bcfc6e095d 100644 --- a/test/mjsunit/disabled/test-eio-race3.js +++ b/test/disabled/test-eio-race3.js diff --git a/test/mjsunit/disabled/test-fs-sendfile.js b/test/disabled/test-fs-sendfile.js index 41e16dffcf..41e16dffcf 100644 --- a/test/mjsunit/disabled/test-fs-sendfile.js +++ b/test/disabled/test-fs-sendfile.js diff --git a/test/mjsunit/disabled/test-http-stress.js b/test/disabled/test-http-stress.js index 003d19fdd2..003d19fdd2 100644 --- a/test/mjsunit/disabled/test-http-stress.js +++ b/test/disabled/test-http-stress.js diff --git a/test/mjsunit/fixtures/a.js b/test/fixtures/a.js index 4b9927ee41..4b9927ee41 100644 --- a/test/mjsunit/fixtures/a.js +++ b/test/fixtures/a.js diff --git a/test/mjsunit/fixtures/b/c.js b/test/fixtures/b/c.js index 6aaf186726..6aaf186726 100644 --- a/test/mjsunit/fixtures/b/c.js +++ b/test/fixtures/b/c.js diff --git a/test/mjsunit/fixtures/b/d.js b/test/fixtures/b/d.js index 076d96af74..076d96af74 100644 --- a/test/mjsunit/fixtures/b/d.js +++ b/test/fixtures/b/d.js diff --git a/test/mjsunit/fixtures/b/package/index.js b/test/fixtures/b/package/index.js index 4a19b877e5..4a19b877e5 100644 --- a/test/mjsunit/fixtures/b/package/index.js +++ b/test/fixtures/b/package/index.js diff --git a/test/mjsunit/fixtures/cycles/folder/foo.js b/test/fixtures/cycles/folder/foo.js index 3763a11875..3763a11875 100644 --- a/test/mjsunit/fixtures/cycles/folder/foo.js +++ b/test/fixtures/cycles/folder/foo.js diff --git a/test/mjsunit/fixtures/cycles/root.js b/test/fixtures/cycles/root.js index b515639a23..b515639a23 100644 --- a/test/mjsunit/fixtures/cycles/root.js +++ b/test/fixtures/cycles/root.js diff --git a/test/mjsunit/fixtures/echo.js b/test/fixtures/echo.js index 0aed0ff84c..0aed0ff84c 100644 --- a/test/mjsunit/fixtures/echo.js +++ b/test/fixtures/echo.js diff --git a/test/mjsunit/fixtures/multipart.js b/test/fixtures/multipart.js index 726fec7e5a..726fec7e5a 100644 --- a/test/mjsunit/fixtures/multipart.js +++ b/test/fixtures/multipart.js diff --git a/test/mjsunit/fixtures/nested-index/one/hello.js b/test/fixtures/nested-index/one/hello.js index e287275629..e287275629 100644 --- a/test/mjsunit/fixtures/nested-index/one/hello.js +++ b/test/fixtures/nested-index/one/hello.js diff --git a/test/mjsunit/fixtures/nested-index/one/index.js b/test/fixtures/nested-index/one/index.js index d959a288b1..d959a288b1 100644 --- a/test/mjsunit/fixtures/nested-index/one/index.js +++ b/test/fixtures/nested-index/one/index.js diff --git a/test/mjsunit/fixtures/nested-index/two/hello.js b/test/fixtures/nested-index/two/hello.js index fead2bde46..fead2bde46 100644 --- a/test/mjsunit/fixtures/nested-index/two/hello.js +++ b/test/fixtures/nested-index/two/hello.js diff --git a/test/mjsunit/fixtures/nested-index/two/index.js b/test/fixtures/nested-index/two/index.js index d959a288b1..d959a288b1 100644 --- a/test/mjsunit/fixtures/nested-index/two/index.js +++ b/test/fixtures/nested-index/two/index.js diff --git a/test/mjsunit/fixtures/print-chars.js b/test/fixtures/print-chars.js index ba539ffb76..ba539ffb76 100644 --- a/test/mjsunit/fixtures/print-chars.js +++ b/test/fixtures/print-chars.js diff --git a/test/mjsunit/fixtures/test_ca.pem b/test/fixtures/test_ca.pem index a3c1e4a0aa..a3c1e4a0aa 100644 --- a/test/mjsunit/fixtures/test_ca.pem +++ b/test/fixtures/test_ca.pem diff --git a/test/mjsunit/fixtures/test_cert.pem b/test/fixtures/test_cert.pem index a3c1e4a0aa..a3c1e4a0aa 100644 --- a/test/mjsunit/fixtures/test_cert.pem +++ b/test/fixtures/test_cert.pem diff --git a/test/mjsunit/fixtures/test_key.pem b/test/fixtures/test_key.pem index 48fd93c994..48fd93c994 100644 --- a/test/mjsunit/fixtures/test_key.pem +++ b/test/fixtures/test_key.pem diff --git a/test/mjsunit/fixtures/throws_error.js b/test/fixtures/throws_error.js index 728ece555f..728ece555f 100644 --- a/test/mjsunit/fixtures/throws_error.js +++ b/test/fixtures/throws_error.js diff --git a/test/mjsunit/fixtures/x.txt b/test/fixtures/x.txt index cd470e6190..cd470e6190 100644 --- a/test/mjsunit/fixtures/x.txt +++ b/test/fixtures/x.txt diff --git a/test/internet/internet.status b/test/internet/internet.status new file mode 100644 index 0000000000..34aea6a6af --- /dev/null +++ b/test/internet/internet.status @@ -0,0 +1 @@ +prefix internet diff --git a/test/mjsunit/testcfg.py b/test/internet/testcfg.py index 5e74466acf..7d730edebd 100644 --- a/test/mjsunit/testcfg.py +++ b/test/internet/testcfg.py @@ -35,10 +35,10 @@ FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)") FILES_PATTERN = re.compile(r"//\s+Files:(.*)") -class MjsunitTestCase(test.TestCase): +class SimpleTestCase(test.TestCase): def __init__(self, path, file, mode, context, config): - super(MjsunitTestCase, self).__init__(context, path) + super(SimpleTestCase, self).__init__(context, path) self.file = file self.config = config self.mode = mode @@ -68,10 +68,10 @@ class MjsunitTestCase(test.TestCase): return open(self.file).read() -class MjsunitTestConfiguration(test.TestConfiguration): +class SimpleTestConfiguration(test.TestConfiguration): def __init__(self, context, root): - super(MjsunitTestConfiguration, self).__init__(context, root) + super(SimpleTestConfiguration, self).__init__(context, root) def Ls(self, path): def SelectTest(name): @@ -79,27 +79,30 @@ class MjsunitTestConfiguration(test.TestConfiguration): return [f[:-3] for f in os.listdir(path) if SelectTest(f)] def ListTests(self, current_path, path, mode): - mjsunit = [current_path + [t] for t in self.Ls(self.root)] + 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 = mjsunit # + regress + bugs + 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(MjsunitTestCase(test, file_path, mode, self.context, self)) + 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, 'mjsunit.status') + status_file = join(self.root, 'simple.status') if exists(status_file): test.ReadConfigurationInto(status_file, sections, defs) def GetConfiguration(context, root): - return MjsunitTestConfiguration(context, root) + return SimpleTestConfiguration(context, root) diff --git a/test/mjsunit/test-sync-fileread.js b/test/mjsunit/test-sync-fileread.js deleted file mode 100644 index 8c337ee0a9..0000000000 --- a/test/mjsunit/test-sync-fileread.js +++ /dev/null @@ -1,5 +0,0 @@ -process.mixin(require('./common')); - -var fixture = path.join(__dirname, "fixtures/x.txt"); - -assert.equal("xyz\n", fs.readFileSync(fixture)); diff --git a/test/pummel/pummel.status b/test/pummel/pummel.status new file mode 100644 index 0000000000..87224bb70b --- /dev/null +++ b/test/pummel/pummel.status @@ -0,0 +1 @@ +prefix pummel diff --git a/test/mjsunit/test-http-client-reconnect-bug.js b/test/pummel/test-http-client-reconnect-bug.js index 29a9feecff..0440a52a1f 100644 --- a/test/mjsunit/test-http-client-reconnect-bug.js +++ b/test/pummel/test-http-client-reconnect-bug.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var tcp = require("tcp"), sys = require("sys"), diff --git a/test/mjsunit/test-keep-alive.js b/test/pummel/test-keep-alive.js index f4d2933bb3..4b8dc93ea7 100644 --- a/test/mjsunit/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -1,5 +1,5 @@ // This test requires the program "ab" -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); sys = require("sys"); PORT = 8891; diff --git a/test/mjsunit/test-multipart.js b/test/pummel/test-multipart.js index ba10b60d47..b542e99acc 100644 --- a/test/mjsunit/test-multipart.js +++ b/test/pummel/test-multipart.js @@ -1,10 +1,10 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var http = require("http"), multipart = require("multipart"), sys = require("sys"), PORT = 8222, - fixture = require("./fixtures/multipart"), + fixture = require("../fixtures/multipart"), events = require("events"), testPart = function (expect, part) { if (!expect) { diff --git a/test/mjsunit/test-process-spawn-loop.js b/test/pummel/test-process-spawn-loop.js index 2453451a38..9a639ee9f1 100644 --- a/test/mjsunit/test-process-spawn-loop.js +++ b/test/pummel/test-process-spawn-loop.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var N = 40; var finished = false; diff --git a/test/mjsunit/test-tcp-many-clients.js b/test/pummel/test-tcp-many-clients.js index 5d229834d1..4653733faa 100644 --- a/test/mjsunit/test-tcp-many-clients.js +++ b/test/pummel/test-tcp-many-clients.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); // settings var port = 20743; diff --git a/test/mjsunit/test-tcp-pingpong-delay.js b/test/pummel/test-tcp-pingpong-delay.js index b8d2d06451..ae6868a8a2 100644 --- a/test/mjsunit/test-tcp-pingpong-delay.js +++ b/test/pummel/test-tcp-pingpong-delay.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); diff --git a/test/mjsunit/test-tcp-pingpong.js b/test/pummel/test-tcp-pingpong.js index 3f067be2fb..75e302c5f9 100644 --- a/test/mjsunit/test-tcp-pingpong.js +++ b/test/pummel/test-tcp-pingpong.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); diff --git a/test/mjsunit/test-tcp-throttle-kernel-buffer.js b/test/pummel/test-tcp-throttle-kernel-buffer.js index a8fab1f5b3..6f966fbc88 100644 --- a/test/mjsunit/test-tcp-throttle-kernel-buffer.js +++ b/test/pummel/test-tcp-throttle-kernel-buffer.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); PORT = 20444; N = 30*1024; // 500kb diff --git a/test/mjsunit/test-tcp-throttle.js b/test/pummel/test-tcp-throttle.js index 7e927d2d05..57ccec190a 100644 --- a/test/mjsunit/test-tcp-throttle.js +++ b/test/pummel/test-tcp-throttle.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); PORT = 20443; N = 200; diff --git a/test/mjsunit/test-tcp-timeout.js b/test/pummel/test-tcp-timeout.js index b2f363d2da..1fd95540cb 100644 --- a/test/mjsunit/test-tcp-timeout.js +++ b/test/pummel/test-tcp-timeout.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); port = 9992; exchanges = 0; diff --git a/test/mjsunit/test-tcp-tls.js b/test/pummel/test-tcp-tls.js index b823780ebc..0635ea58dc 100644 --- a/test/mjsunit/test-tcp-tls.js +++ b/test/pummel/test-tcp-tls.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); fs=require("fs"); diff --git a/test/mjsunit/test-timers.js b/test/pummel/test-timers.js index f97ff85662..853df08ae3 100644 --- a/test/mjsunit/test-timers.js +++ b/test/pummel/test-timers.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var WINDOW = 200; // why is does this need to be so big? diff --git a/test/mjsunit/test-watch-file.js b/test/pummel/test-watch-file.js index 977e5838ab..1c235d6d17 100644 --- a/test/mjsunit/test-watch-file.js +++ b/test/pummel/test-watch-file.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var path = require("path"); diff --git a/test/pummel/testcfg.py b/test/pummel/testcfg.py new file mode 100644 index 0000000000..7d730edebd --- /dev/null +++ b/test/pummel/testcfg.py @@ -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) diff --git a/test/simple/simple.status b/test/simple/simple.status new file mode 100644 index 0000000000..438ce39f5f --- /dev/null +++ b/test/simple/simple.status @@ -0,0 +1 @@ +prefix simple diff --git a/test/mjsunit/test-assert.js b/test/simple/test-assert.js index d8d546a901..ea725f284c 100644 --- a/test/mjsunit/test-assert.js +++ b/test/simple/test-assert.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var a = require('assert'); diff --git a/test/mjsunit/test-byte-length.js b/test/simple/test-byte-length.js index 246a33dcda..cd0f2c4814 100644 --- a/test/mjsunit/test-byte-length.js +++ b/test/simple/test-byte-length.js @@ -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é", "utf8")); diff --git a/test/mjsunit/test-chdir.js b/test/simple/test-chdir.js index bd7f065d1d..1fd58ddaf6 100644 --- a/test/mjsunit/test-chdir.js +++ b/test/simple/test-chdir.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var dirname = path.dirname(__filename); diff --git a/test/mjsunit/test-delayed-require.js b/test/simple/test-delayed-require.js index a9172687d6..ed9b9d8562 100644 --- a/test/mjsunit/test-delayed-require.js +++ b/test/simple/test-delayed-require.js @@ -1,7 +1,7 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); setTimeout(function () { - a = require("./fixtures/a"); + a = require("../fixtures/a"); }, 50); process.addListener("exit", function () { diff --git a/test/mjsunit/test-eio-race.js b/test/simple/test-eio-race.js index 0245d5dbc6..bb9045ce13 100644 --- a/test/mjsunit/test-eio-race.js +++ b/test/simple/test-eio-race.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var count = 100; var fs = require('fs'); diff --git a/test/mjsunit/test-eio-race2.js b/test/simple/test-eio-race2.js index d41f37c6f6..11f989a61a 100644 --- a/test/mjsunit/test-eio-race2.js +++ b/test/simple/test-eio-race2.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var testTxt = path.join(fixturesDir, "x.txt"); var fs = require('fs'); diff --git a/test/mjsunit/test-eio-race4.js b/test/simple/test-eio-race4.js index 7004ee80a4..1792798284 100644 --- a/test/mjsunit/test-eio-race4.js +++ b/test/simple/test-eio-race4.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var N = 100; var j = 0; diff --git a/test/mjsunit/test-event-emitter-add-listeners.js b/test/simple/test-event-emitter-add-listeners.js index 643b8d8dde..2294372050 100644 --- a/test/mjsunit/test-event-emitter-add-listeners.js +++ b/test/simple/test-event-emitter-add-listeners.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var events = require('events'); var e = new events.EventEmitter(); diff --git a/test/mjsunit/test-event-emitter-modify-in-emit.js b/test/simple/test-event-emitter-modify-in-emit.js index 7bb2eb3292..cfd31ca519 100644 --- a/test/mjsunit/test-event-emitter-modify-in-emit.js +++ b/test/simple/test-event-emitter-modify-in-emit.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var events = require('events'); var callbacks_called = [ ]; diff --git a/test/mjsunit/test-exception-handler.js b/test/simple/test-exception-handler.js index 3fc82cfe5e..fab4e44a44 100644 --- a/test/mjsunit/test-exception-handler.js +++ b/test/simple/test-exception-handler.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var MESSAGE = 'catch me if you can'; var caughtException = false; diff --git a/test/mjsunit/test-exec.js b/test/simple/test-exec.js index f817ebd696..7f9dd8db17 100644 --- a/test/mjsunit/test-exec.js +++ b/test/simple/test-exec.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); success_count = 0; error_count = 0; diff --git a/test/mjsunit/test-file-read-noexist.js b/test/simple/test-file-read-noexist.js index da28964165..a68c4662c6 100644 --- a/test/mjsunit/test-file-read-noexist.js +++ b/test/simple/test-file-read-noexist.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var got_error = false; var filename = path.join(fixturesDir, "does_not_exist.txt"); diff --git a/test/mjsunit/test-fs-chmod.js b/test/simple/test-fs-chmod.js index 71bd5b7d70..c4a7829b15 100644 --- a/test/mjsunit/test-fs-chmod.js +++ b/test/simple/test-fs-chmod.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var got_error = false; var success_count = 0; diff --git a/test/mjsunit/test-fs-stat.js b/test/simple/test-fs-stat.js index cea18a2e11..088ad696a9 100644 --- a/test/mjsunit/test-fs-stat.js +++ b/test/simple/test-fs-stat.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var got_error = false; var success_count = 0; diff --git a/test/mjsunit/test-fs-symlink.js b/test/simple/test-fs-symlink.js index 2bf1e82df3..ac9a3ab803 100644 --- a/test/mjsunit/test-fs-symlink.js +++ b/test/simple/test-fs-symlink.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var completed = 0; diff --git a/test/mjsunit/test-fs-write.js b/test/simple/test-fs-write.js index 33b6d01e50..d2bd1d581e 100644 --- a/test/mjsunit/test-fs-write.js +++ b/test/simple/test-fs-write.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var fn = path.join(fixturesDir, "write.txt"); var expected = "hello"; diff --git a/test/mjsunit/test-http-1.0.js b/test/simple/test-http-1.0.js index 911cb1ca0d..801972ca2f 100644 --- a/test/mjsunit/test-http-1.0.js +++ b/test/simple/test-http-1.0.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); http = require("http"); diff --git a/test/mjsunit/test-http-cat.js b/test/simple/test-http-cat.js index bda98c15b9..9e26b4b3a4 100644 --- a/test/mjsunit/test-http-cat.js +++ b/test/simple/test-http-cat.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); PORT = 8888; diff --git a/test/mjsunit/test-http-chunked.js b/test/simple/test-http-chunked.js index d94b8a253e..f1895737b1 100644 --- a/test/mjsunit/test-http-chunked.js +++ b/test/simple/test-http-chunked.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var http = require("http"); var PORT = 8888; diff --git a/test/mjsunit/test-http-client-race.js b/test/simple/test-http-client-race.js index b1f1237c21..3541830f06 100644 --- a/test/mjsunit/test-http-client-race.js +++ b/test/simple/test-http-client-race.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); url = require("url"); PORT = 8888; diff --git a/test/mjsunit/test-http-client-upload.js b/test/simple/test-http-client-upload.js index dbe36e1863..880b229f29 100644 --- a/test/mjsunit/test-http-client-upload.js +++ b/test/simple/test-http-client-upload.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); var PORT = 18032; diff --git a/test/mjsunit/test-http-eof-on-connect.js b/test/simple/test-http-eof-on-connect.js index a385c377f3..6be2e71a66 100644 --- a/test/mjsunit/test-http-eof-on-connect.js +++ b/test/simple/test-http-eof-on-connect.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); http = require("http"); diff --git a/test/mjsunit/test-http-malformed-request.js b/test/simple/test-http-malformed-request.js index 5397e9f5ed..5d2efc17f2 100644 --- a/test/mjsunit/test-http-malformed-request.js +++ b/test/simple/test-http-malformed-request.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); http = require("http"); url = require("url"); diff --git a/test/mjsunit/test-http-proxy.js b/test/simple/test-http-proxy.js index d11d2dd6aa..5f7bac5269 100644 --- a/test/mjsunit/test-http-proxy.js +++ b/test/simple/test-http-proxy.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); url = require("url"); diff --git a/test/mjsunit/test-http-server.js b/test/simple/test-http-server.js index fe569ce42d..b9f48000ca 100644 --- a/test/mjsunit/test-http-server.js +++ b/test/simple/test-http-server.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); http = require("http"); url = require("url"); diff --git a/test/mjsunit/test-http-tls.js b/test/simple/test-http-tls.js index ffe042c1f4..9931982894 100644 --- a/test/mjsunit/test-http-tls.js +++ b/test/simple/test-http-tls.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); url = require("url"); PORT = 8888; diff --git a/test/mjsunit/test-http-wget.js b/test/simple/test-http-wget.js index 931fe44ddb..5563a3dd70 100644 --- a/test/mjsunit/test-http-wget.js +++ b/test/simple/test-http-wget.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); http = require("http"); diff --git a/test/mjsunit/test-http.js b/test/simple/test-http.js index 83daac910a..b5ecdbef20 100644 --- a/test/mjsunit/test-http.js +++ b/test/simple/test-http.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); http = require("http"); url = require("url"); PORT = 8888; diff --git a/test/mjsunit/test-idle-watcher.js b/test/simple/test-idle-watcher.js index cd037fb442..8bfca5dfaa 100644 --- a/test/mjsunit/test-idle-watcher.js +++ b/test/simple/test-idle-watcher.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var complete = false; var idle = new process.IdleWatcher(); diff --git a/test/mjsunit/test-memory-usage.js b/test/simple/test-memory-usage.js index 8b9c55d1f4..8a2a29fc64 100644 --- a/test/mjsunit/test-memory-usage.js +++ b/test/simple/test-memory-usage.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var r = process.memoryUsage(); puts(inspect(r)); diff --git a/test/mjsunit/test-mkdir-rmdir.js b/test/simple/test-mkdir-rmdir.js index 9e3f78734d..b19d6ac295 100644 --- a/test/mjsunit/test-mkdir-rmdir.js +++ b/test/simple/test-mkdir-rmdir.js @@ -1,7 +1,7 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var dirname = path.dirname(__filename); -var fixtures = path.join(dirname, "fixtures"); +var fixtures = path.join(dirname, "../fixtures"); var d = path.join(fixtures, "dir"); var mkdir_error = false; diff --git a/test/mjsunit/test-module-loading.js b/test/simple/test-module-loading.js index 8058cb2e77..0c453b6d72 100644 --- a/test/mjsunit/test-module-loading.js +++ b/test/simple/test-module-loading.js @@ -1,15 +1,15 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); debug("load test-module-loading.js"); -var a = require("./fixtures/a"); -var c = require("./fixtures/b/c"); -var d = require("./fixtures/b/d"); -var d2 = require("./fixtures/b/d"); +var a = require("../fixtures/a"); +var c = require("../fixtures/b/c"); +var d = require("../fixtures/b/d"); +var d2 = require("../fixtures/b/d"); // Absolute -var d3 = require(__dirname+"/fixtures/b/d"); +var d3 = require(path.join(__dirname, "../fixtures/b/d")); // Relative -var d4 = require("../mjsunit/fixtures/b/d"); +var d4 = require("../fixtures/b/d"); assert.equal(false, false, "testing the test program."); @@ -37,19 +37,19 @@ assert.equal("D", d4.D()); assert.ok((new a.SomeClass) instanceof c.SomeClass); debug("test index.js modules ids and relative loading") -var one = require("./fixtures/nested-index/one"), - two = require("./fixtures/nested-index/two"); +var one = require("../fixtures/nested-index/one"), + two = require("../fixtures/nested-index/two"); assert.notEqual(one.hello, two.hello); debug("test cycles containing a .. path"); -var root = require("./fixtures/cycles/root"), - foo = require("./fixtures/cycles/folder/foo"); +var root = require("../fixtures/cycles/root"), + foo = require("../fixtures/cycles/folder/foo"); assert.equal(root.foo, foo); assert.equal(root.sayHello(), root.hello); var errorThrown = false; try { - require("./fixtures/throws_error"); + require("../fixtures/throws_error"); } catch (e) { errorThrown = true; assert.equal("blah", e.message); @@ -57,7 +57,7 @@ try { assert.equal(require('path').dirname(__filename), __dirname); -require.async('./fixtures/a', function (err, a) { +require.async('../fixtures/a', function (err, a) { if (err) throw err; assert.equal("A", a.A()); }); diff --git a/test/mjsunit/test-next-tick.js b/test/simple/test-next-tick.js index 1dd20574ad..9758535320 100644 --- a/test/mjsunit/test-next-tick.js +++ b/test/simple/test-next-tick.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var complete = 0; diff --git a/test/mjsunit/test-path.js b/test/simple/test-path.js index 42c6559769..961d6d1fa2 100644 --- a/test/mjsunit/test-path.js +++ b/test/simple/test-path.js @@ -1,12 +1,12 @@ var path = require("path"); -process.mixin(require("./common")); +process.mixin(require("../common")); var f = __filename; assert.equal(path.basename(f), "test-path.js"); assert.equal(path.basename(f, ".js"), "test-path"); 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) }); assert.equal(path.join(".", "fixtures/b", "..", "/b/c.js"), "fixtures/b/c.js"); diff --git a/test/mjsunit/test-process-buffering.js b/test/simple/test-process-buffering.js index 6c16c9bf61..50d6ae622c 100644 --- a/test/mjsunit/test-process-buffering.js +++ b/test/simple/test-process-buffering.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var pwd_called = false; diff --git a/test/mjsunit/test-process-kill.js b/test/simple/test-process-kill.js index 8d642f7e70..9d2bf091f1 100644 --- a/test/mjsunit/test-process-kill.js +++ b/test/simple/test-process-kill.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var exit_status = -1; diff --git a/test/mjsunit/test-process-mixin.js b/test/simple/test-process-mixin.js index cf5fe6c7f4..18d21f53ef 100644 --- a/test/mjsunit/test-process-mixin.js +++ b/test/simple/test-process-mixin.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var target = function() {}; process.mixin(target, { diff --git a/test/mjsunit/test-process-simple.js b/test/simple/test-process-simple.js index a4e58f1369..ab6f87a21a 100644 --- a/test/mjsunit/test-process-simple.js +++ b/test/simple/test-process-simple.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var cat = process.createChildProcess("cat"); diff --git a/test/mjsunit/test-querystring.js b/test/simple/test-querystring.js index 19f7ee3902..58a70fe0c4 100644 --- a/test/mjsunit/test-querystring.js +++ b/test/simple/test-querystring.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); // test using assert diff --git a/test/mjsunit/test-readdir.js b/test/simple/test-readdir.js index 4ded485571..0838a980c1 100644 --- a/test/mjsunit/test-readdir.js +++ b/test/simple/test-readdir.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var got_error = false; diff --git a/test/mjsunit/test-remote-module-loading.js b/test/simple/test-remote-module-loading.js index 98179086a4..350e78ea9e 100644 --- a/test/mjsunit/test-remote-module-loading.js +++ b/test/simple/test-remote-module-loading.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var PORT = 8889; var http = require('http'); diff --git a/test/mjsunit/test-signal-handler.js b/test/simple/test-signal-handler.js index 5348bdd27d..a2d76e651a 100644 --- a/test/mjsunit/test-signal-handler.js +++ b/test/simple/test-signal-handler.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); puts("process.pid: " + process.pid); diff --git a/test/mjsunit/test-stdio.js b/test/simple/test-stdio.js index 786e9e187a..e30378c868 100644 --- a/test/mjsunit/test-stdio.js +++ b/test/simple/test-stdio.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var sub = path.join(fixturesDir, 'echo.js'); diff --git a/test/mjsunit/test-stdout-flush.js b/test/simple/test-stdout-flush.js index 58c945bea9..38f61d9084 100644 --- a/test/mjsunit/test-stdout-flush.js +++ b/test/simple/test-stdout-flush.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var sub = path.join(fixturesDir, 'print-chars.js'); diff --git a/test/simple/test-sync-fileread.js b/test/simple/test-sync-fileread.js new file mode 100644 index 0000000000..adbe2e84a6 --- /dev/null +++ b/test/simple/test-sync-fileread.js @@ -0,0 +1,5 @@ +process.mixin(require('../common')); + +var fixture = path.join(__dirname, "../fixtures/x.txt"); + +assert.equal("xyz\n", fs.readFileSync(fixture)); diff --git a/test/mjsunit/test-sys.js b/test/simple/test-sys.js index 648452b0da..bff7d2704b 100644 --- a/test/mjsunit/test-sys.js +++ b/test/simple/test-sys.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); process.mixin(require("sys")); assert.equal("0", inspect(0)); diff --git a/test/mjsunit/test-tcp-binary.js b/test/simple/test-tcp-binary.js index 1bdc33ad66..fb2b8b4f2b 100644 --- a/test/mjsunit/test-tcp-binary.js +++ b/test/simple/test-tcp-binary.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); PORT = 23123; diff --git a/test/mjsunit/test-tcp-reconnect.js b/test/simple/test-tcp-reconnect.js index 4bf4ed8945..65563b644b 100644 --- a/test/mjsunit/test-tcp-reconnect.js +++ b/test/simple/test-tcp-reconnect.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); tcp = require("tcp"); var N = 50; var port = 8921; diff --git a/test/mjsunit/test-umask.js b/test/simple/test-umask.js index 0309a8eadd..5509cd132c 100644 --- a/test/mjsunit/test-umask.js +++ b/test/simple/test-umask.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var mask = 0664; var old = process.umask(mask); diff --git a/test/mjsunit/test-url.js b/test/simple/test-url.js index 1ec6b7100f..b474812d87 100644 --- a/test/mjsunit/test-url.js +++ b/test/simple/test-url.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); var url = require("url"), sys = require("sys"); diff --git a/test/mjsunit/test-utf8-scripts.js b/test/simple/test-utf8-scripts.js index a8f2e96332..8346d43fac 100644 --- a/test/mjsunit/test-utf8-scripts.js +++ b/test/simple/test-utf8-scripts.js @@ -1,4 +1,4 @@ -process.mixin(require("./common")); +process.mixin(require("../common")); // üäö diff --git a/test/simple/testcfg.py b/test/simple/testcfg.py new file mode 100644 index 0000000000..7d730edebd --- /dev/null +++ b/test/simple/testcfg.py @@ -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) |