Skip to content
Browse files

Split tests.

  • Loading branch information...
1 parent 9ad7539 commit 04fac198225ae48ed7726c15609d254fddce4862 @arlolra arlolra committed with ry
Showing with 325 additions and 94 deletions.
  1. +9 −0 Makefile
  2. 0 test/{mjsunit → }/common.js
  3. 0 test/{mjsunit → }/disabled/test-cat.js
  4. 0 test/{mjsunit → }/disabled/test-dns.js
  5. 0 test/{mjsunit → }/disabled/test-eio-race3.js
  6. 0 test/{mjsunit → }/disabled/test-fs-sendfile.js
  7. 0 test/{mjsunit → }/disabled/test-http-stress.js
  8. 0 test/{mjsunit → }/fixtures/a.js
  9. 0 test/{mjsunit → }/fixtures/b/c.js
  10. 0 test/{mjsunit → }/fixtures/b/d.js
  11. 0 test/{mjsunit → }/fixtures/b/package/index.js
  12. 0 test/{mjsunit → }/fixtures/cycles/folder/foo.js
  13. 0 test/{mjsunit → }/fixtures/cycles/root.js
  14. 0 test/{mjsunit → }/fixtures/echo.js
  15. 0 test/{mjsunit → }/fixtures/multipart.js
  16. 0 test/{mjsunit → }/fixtures/nested-index/one/hello.js
  17. 0 test/{mjsunit/fixtures/nested-index/two → fixtures/nested-index/one}/index.js
  18. 0 test/{mjsunit → }/fixtures/nested-index/two/hello.js
  19. 0 test/{mjsunit/fixtures/nested-index/one → fixtures/nested-index/two}/index.js
  20. 0 test/{mjsunit → }/fixtures/print-chars.js
  21. 0 test/{mjsunit → }/fixtures/test_ca.pem
  22. 0 test/{mjsunit → }/fixtures/test_cert.pem
  23. 0 test/{mjsunit → }/fixtures/test_key.pem
  24. 0 test/{mjsunit → }/fixtures/throws_error.js
  25. 0 test/{mjsunit → }/fixtures/x.txt
  26. +1 −0 test/internet/internet.status
  27. +12 −9 test/{mjsunit → internet}/testcfg.py
  28. +0 −5 test/mjsunit/test-sync-fileread.js
  29. +1 −0 test/pummel/pummel.status
  30. +1 −1 test/{mjsunit → pummel}/test-http-client-reconnect-bug.js
  31. +1 −1 test/{mjsunit → pummel}/test-keep-alive.js
  32. +2 −2 test/{mjsunit → pummel}/test-multipart.js
  33. +1 −1 test/{mjsunit → pummel}/test-process-spawn-loop.js
  34. +1 −1 test/{mjsunit → pummel}/test-tcp-many-clients.js
  35. +1 −1 test/{mjsunit → pummel}/test-tcp-pingpong-delay.js
  36. +1 −1 test/{mjsunit → pummel}/test-tcp-pingpong.js
  37. +1 −1 test/{mjsunit → pummel}/test-tcp-throttle-kernel-buffer.js
  38. +1 −1 test/{mjsunit → pummel}/test-tcp-throttle.js
  39. +1 −1 test/{mjsunit → pummel}/test-tcp-timeout.js
  40. +1 −1 test/{mjsunit → pummel}/test-tcp-tls.js
  41. +1 −1 test/{mjsunit → pummel}/test-timers.js
  42. +1 −1 test/{mjsunit → pummel}/test-watch-file.js
  43. +108 −0 test/pummel/testcfg.py
  44. +1 −0 test/simple/simple.status
  45. +1 −1 test/{mjsunit → simple}/test-assert.js
  46. +1 −1 test/{mjsunit → simple}/test-byte-length.js
  47. +1 −1 test/{mjsunit → simple}/test-chdir.js
  48. +2 −2 test/{mjsunit → simple}/test-delayed-require.js
  49. +1 −1 test/{mjsunit → simple}/test-eio-race.js
  50. +1 −1 test/{mjsunit → simple}/test-eio-race2.js
  51. +1 −1 test/{mjsunit → simple}/test-eio-race4.js
  52. +1 −1 test/{mjsunit → simple}/test-event-emitter-add-listeners.js
  53. +1 −1 test/{mjsunit → simple}/test-event-emitter-modify-in-emit.js
  54. +1 −1 test/{mjsunit → simple}/test-exception-handler.js
  55. +1 −1 test/{mjsunit → simple}/test-exec.js
  56. +1 −1 test/{mjsunit → simple}/test-file-read-noexist.js
  57. +1 −1 test/{mjsunit → simple}/test-fs-chmod.js
  58. +1 −1 test/{mjsunit → simple}/test-fs-stat.js
  59. +1 −1 test/{mjsunit → simple}/test-fs-symlink.js
  60. +1 −1 test/{mjsunit → simple}/test-fs-write.js
  61. +1 −1 test/{mjsunit → simple}/test-http-1.0.js
  62. +1 −1 test/{mjsunit → simple}/test-http-cat.js
  63. +1 −1 test/{mjsunit → simple}/test-http-chunked.js
  64. +1 −1 test/{mjsunit → simple}/test-http-client-race.js
  65. +1 −1 test/{mjsunit → simple}/test-http-client-upload.js
  66. +1 −1 test/{mjsunit → simple}/test-http-eof-on-connect.js
  67. +1 −1 test/{mjsunit → simple}/test-http-malformed-request.js
  68. +1 −1 test/{mjsunit → simple}/test-http-proxy.js
  69. +1 −1 test/{mjsunit → simple}/test-http-server.js
  70. +1 −1 test/{mjsunit → simple}/test-http-tls.js
  71. +1 −1 test/{mjsunit → simple}/test-http-wget.js
  72. +1 −1 test/{mjsunit → simple}/test-http.js
  73. +1 −1 test/{mjsunit → simple}/test-idle-watcher.js
  74. +1 −1 test/{mjsunit → simple}/test-memory-usage.js
  75. +2 −2 test/{mjsunit → simple}/test-mkdir-rmdir.js
  76. +13 −13 test/{mjsunit → simple}/test-module-loading.js
  77. +1 −1 test/{mjsunit → simple}/test-next-tick.js
  78. +2 −2 test/{mjsunit → simple}/test-path.js
  79. +1 −1 test/{mjsunit → simple}/test-process-buffering.js
  80. +1 −1 test/{mjsunit → simple}/test-process-kill.js
  81. +1 −1 test/{mjsunit → simple}/test-process-mixin.js
  82. +1 −1 test/{mjsunit → simple}/test-process-simple.js
  83. +1 −1 test/{mjsunit → simple}/test-querystring.js
  84. +1 −1 test/{mjsunit → simple}/test-readdir.js
  85. +1 −1 test/{mjsunit → simple}/test-remote-module-loading.js
  86. +1 −1 test/{mjsunit → simple}/test-signal-handler.js
  87. +1 −1 test/{mjsunit → simple}/test-stdio.js
  88. +1 −1 test/{mjsunit → simple}/test-stdout-flush.js
  89. +5 −0 test/simple/test-sync-fileread.js
  90. +1 −1 test/{mjsunit → simple}/test-sys.js
  91. +1 −1 test/{mjsunit → simple}/test-tcp-binary.js
  92. +1 −1 test/{mjsunit → simple}/test-tcp-reconnect.js
  93. +1 −1 test/{mjsunit → simple}/test-umask.js
  94. +1 −1 test/{mjsunit → simple}/test-url.js
  95. +1 −1 test/{mjsunit → simple}/test-utf8-scripts.js
  96. +108 −0 test/simple/testcfg.py
  97. +1 −1 tools/test.py
View
9 Makefile
@@ -24,6 +24,15 @@ test-all: all
test-debug: all
python tools/test.py --mode=debug
+test-simple: all
+ python tools/test.py simple
+
+test-pummel: all
+ python tools/test.py pummel
+
+test-internet: all
+ python tools/test.py internet
+
benchmark: all
build/default/node benchmark/run.js
View
0 test/mjsunit/common.js → test/common.js
File renamed without changes.
View
0 test/mjsunit/disabled/test-cat.js → test/disabled/test-cat.js
File renamed without changes.
View
0 test/mjsunit/disabled/test-dns.js → test/disabled/test-dns.js
File renamed without changes.
View
0 test/mjsunit/disabled/test-eio-race3.js → test/disabled/test-eio-race3.js
File renamed without changes.
View
0 test/mjsunit/disabled/test-fs-sendfile.js → test/disabled/test-fs-sendfile.js
File renamed without changes.
View
0 test/mjsunit/disabled/test-http-stress.js → test/disabled/test-http-stress.js
File renamed without changes.
View
0 test/mjsunit/fixtures/a.js → test/fixtures/a.js
File renamed without changes.
View
0 test/mjsunit/fixtures/b/c.js → test/fixtures/b/c.js
File renamed without changes.
View
0 test/mjsunit/fixtures/b/d.js → test/fixtures/b/d.js
File renamed without changes.
View
0 test/mjsunit/fixtures/b/package/index.js → test/fixtures/b/package/index.js
File renamed without changes.
View
0 test/mjsunit/fixtures/cycles/folder/foo.js → test/fixtures/cycles/folder/foo.js
File renamed without changes.
View
0 test/mjsunit/fixtures/cycles/root.js → test/fixtures/cycles/root.js
File renamed without changes.
View
0 test/mjsunit/fixtures/echo.js → test/fixtures/echo.js
File renamed without changes.
View
0 test/mjsunit/fixtures/multipart.js → test/fixtures/multipart.js
File renamed without changes.
View
0 ...jsunit/fixtures/nested-index/one/hello.js → test/fixtures/nested-index/one/hello.js
File renamed without changes.
View
0 ...jsunit/fixtures/nested-index/two/index.js → test/fixtures/nested-index/one/index.js
File renamed without changes.
View
0 ...jsunit/fixtures/nested-index/two/hello.js → test/fixtures/nested-index/two/hello.js
File renamed without changes.
View
0 ...jsunit/fixtures/nested-index/one/index.js → test/fixtures/nested-index/two/index.js
File renamed without changes.
View
0 test/mjsunit/fixtures/print-chars.js → test/fixtures/print-chars.js
File renamed without changes.
View
0 test/mjsunit/fixtures/test_ca.pem → test/fixtures/test_ca.pem
File renamed without changes.
View
0 test/mjsunit/fixtures/test_cert.pem → test/fixtures/test_cert.pem
File renamed without changes.
View
0 test/mjsunit/fixtures/test_key.pem → test/fixtures/test_key.pem
File renamed without changes.
View
0 test/mjsunit/fixtures/throws_error.js → test/fixtures/throws_error.js
File renamed without changes.
View
0 test/mjsunit/fixtures/x.txt → test/fixtures/x.txt
File renamed without changes.
View
1 test/internet/internet.status
@@ -0,0 +1 @@
+prefix internet
View
21 test/mjsunit/testcfg.py → test/internet/testcfg.py
@@ -35,10 +35,10 @@
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 @@ def GetSource(self):
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 @@ def SelectTest(name):
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)
View
5 test/mjsunit/test-sync-fileread.js
@@ -1,5 +0,0 @@
-process.mixin(require('./common'));
-
-var fixture = path.join(__dirname, "fixtures/x.txt");
-
-assert.equal("xyz\n", fs.readFileSync(fixture));
View
1 test/pummel/pummel.status
@@ -0,0 +1 @@
+prefix pummel
View
2 ...mjsunit/test-http-client-reconnect-bug.js → .../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"),
View
2 test/mjsunit/test-keep-alive.js → 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;
View
4 test/mjsunit/test-multipart.js → 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) {
View
2 test/mjsunit/test-process-spawn-loop.js → 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;
View
2 test/mjsunit/test-tcp-many-clients.js → 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;
View
2 test/mjsunit/test-tcp-pingpong-delay.js → test/pummel/test-tcp-pingpong-delay.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
tcp = require("tcp");
View
2 test/mjsunit/test-tcp-pingpong.js → test/pummel/test-tcp-pingpong.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
tcp = require("tcp");
View
2 ...jsunit/test-tcp-throttle-kernel-buffer.js → ...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
View
2 test/mjsunit/test-tcp-throttle.js → 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;
View
2 test/mjsunit/test-tcp-timeout.js → 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;
View
2 test/mjsunit/test-tcp-tls.js → test/pummel/test-tcp-tls.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
tcp = require("tcp");
fs=require("fs");
View
2 test/mjsunit/test-timers.js → 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?
View
2 test/mjsunit/test-watch-file.js → test/pummel/test-watch-file.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var path = require("path");
View
108 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)
View
1 test/simple/simple.status
@@ -0,0 +1 @@
+prefix simple
View
2 test/mjsunit/test-assert.js → test/simple/test-assert.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var a = require('assert');
View
2 test/mjsunit/test-byte-length.js → 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"));
View
2 test/mjsunit/test-chdir.js → test/simple/test-chdir.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var dirname = path.dirname(__filename);
View
4 test/mjsunit/test-delayed-require.js → 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 () {
View
2 test/mjsunit/test-eio-race.js → 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');
View
2 test/mjsunit/test-eio-race2.js → 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');
View
2 test/mjsunit/test-eio-race4.js → test/simple/test-eio-race4.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var N = 100;
var j = 0;
View
2 ...sunit/test-event-emitter-add-listeners.js → ...imple/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();
View
2 ...unit/test-event-emitter-modify-in-emit.js → ...mple/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 = [ ];
View
2 test/mjsunit/test-exception-handler.js → 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;
View
2 test/mjsunit/test-exec.js → test/simple/test-exec.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
success_count = 0;
error_count = 0;
View
2 test/mjsunit/test-file-read-noexist.js → 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");
View
2 test/mjsunit/test-fs-chmod.js → 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;
View
2 test/mjsunit/test-fs-stat.js → 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;
View
2 test/mjsunit/test-fs-symlink.js → test/simple/test-fs-symlink.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var completed = 0;
View
2 test/mjsunit/test-fs-write.js → 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";
View
2 test/mjsunit/test-http-1.0.js → 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");
View
2 test/mjsunit/test-http-cat.js → test/simple/test-http-cat.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
http = require("http");
PORT = 8888;
View
2 test/mjsunit/test-http-chunked.js → 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;
View
2 test/mjsunit/test-http-client-race.js → 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;
View
2 test/mjsunit/test-http-client-upload.js → 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;
View
2 test/mjsunit/test-http-eof-on-connect.js → 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");
View
2 test/mjsunit/test-http-malformed-request.js → 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");
View
2 test/mjsunit/test-http-proxy.js → test/simple/test-http-proxy.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
http = require("http");
url = require("url");
View
2 test/mjsunit/test-http-server.js → 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");
View
2 test/mjsunit/test-http-tls.js → 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;
View
2 test/mjsunit/test-http-wget.js → test/simple/test-http-wget.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
tcp = require("tcp");
http = require("http");
View
2 test/mjsunit/test-http.js → 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;
View
2 test/mjsunit/test-idle-watcher.js → 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();
View
2 test/mjsunit/test-memory-usage.js → 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));
View
4 test/mjsunit/test-mkdir-rmdir.js → 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;
View
26 test/mjsunit/test-module-loading.js → 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());
});
View
2 test/mjsunit/test-next-tick.js → test/simple/test-next-tick.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var complete = 0;
View
4 test/mjsunit/test-path.js → 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");
View
2 test/mjsunit/test-process-buffering.js → test/simple/test-process-buffering.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var pwd_called = false;
View
2 test/mjsunit/test-process-kill.js → test/simple/test-process-kill.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var exit_status = -1;
View
2 test/mjsunit/test-process-mixin.js → test/simple/test-process-mixin.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var target = function() {};
process.mixin(target, {
View
2 test/mjsunit/test-process-simple.js → test/simple/test-process-simple.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var cat = process.createChildProcess("cat");
View
2 test/mjsunit/test-querystring.js → test/simple/test-querystring.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
// test using assert
View
2 test/mjsunit/test-readdir.js → test/simple/test-readdir.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var got_error = false;
View
2 test/mjsunit/test-remote-module-loading.js → 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');
View
2 test/mjsunit/test-signal-handler.js → test/simple/test-signal-handler.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
puts("process.pid: " + process.pid);
View
2 test/mjsunit/test-stdio.js → test/simple/test-stdio.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var sub = path.join(fixturesDir, 'echo.js');
View
2 test/mjsunit/test-stdout-flush.js → 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');
View
5 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));
View
2 test/mjsunit/test-sys.js → 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));
View
2 test/mjsunit/test-tcp-binary.js → test/simple/test-tcp-binary.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
tcp = require("tcp");
PORT = 23123;
View
2 test/mjsunit/test-tcp-reconnect.js → 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;
View
2 test/mjsunit/test-umask.js → 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);
View
2 test/mjsunit/test-url.js → test/simple/test-url.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
var url = require("url"),
sys = require("sys");
View
2 test/mjsunit/test-utf8-scripts.js → test/simple/test-utf8-scripts.js
@@ -1,4 +1,4 @@
-process.mixin(require("./common"));
+process.mixin(require("../common"));
// üäö
View
108 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)
View
2 tools/test.py
@@ -1195,7 +1195,7 @@ def ExpandCommand(args):
return ExpandCommand
-BUILT_IN_TESTS = ['mjsunit', 'cctest', 'message']
+BUILT_IN_TESTS = ['simple', 'pummel', 'internet']
def GetSuites(test_root):

0 comments on commit 04fac19

Please sign in to comment.
Something went wrong with that request. Please try again.