Permalink
Browse files

more tests work

  • Loading branch information...
1 parent 9387543 commit 4263519869a9cc0aeb66a3e08ebf758b824f5dad @stevedekorte committed May 27, 2010
Showing with 26 additions and 31 deletions.
  1. +4 −0 runtests.sh
  2. +16 −6 server.js
  3. +0 −25 tests/run.js
  4. +6 −0 tests/run.sh
View
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd tests
+./run.sh
View
@@ -1,15 +1,15 @@
-require("./lib/Crux/Crux");
-require("./lib/NodeCrux/NodeCrux");
-require("./lib/Vertex/Vertex");
-
+require("./lib/lib");
var vertex = Vertex.init()
var sys = require('sys');
+var spawn = require('child_process').spawn;
var args = process.argv;
args.shift();
args.shift();
-var option;
+var option;
+var testProcess = null;
+
while (option = args.shift())
{
var value = args.shift();
@@ -24,11 +24,21 @@ while (option = args.shift())
{
vertex.setPort(new Number(value));
}
+ else if (option == "-test")
+ {
+ //process.chdir("./tests")
+ testProcess = spawn('./runtests.sh', []);
+ testProcess.stdout.addListener('data', function (data) { sys.puts(data); });
+ testProcess.stderr.addListener('data', function (data) { sys.puts(data); });
+ }
else
{
sys.puts("Unknown option '" + option + "'")
process.exit()
}
}
-vertex.start();
+if(testProcess == null)
+{
+ vertex.start();
+}
View
@@ -1,25 +0,0 @@
-/*
-var sys = require('sys');
-var spawn = require('child_process').spawn;
-var fs = require('fs');
-var path = require('path');
-
-var files = ['./correctness', '../speed'];
-
-function nextFile()
-{
- var file = files.shift();
- if(file == null) return;
- sys.puts("file: " + file)
- var dir = path.dirname(file);
- sys.puts("dir = " + dir)
- process.chdir(dir)
- var proc = spawn('node', ["run.js"]);
-
- proc.stdout.addListener('data', function (data) { sys.print(data + "."); });
- proc.stderr.addListener('data', function (d) { sys.print(d); });
- proc.addListener('exit', function (code) { nextFile(); });
-}
-
-nextFile();
-*/
View
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd correctness
+node run.js
+cd ../speed
+node run.js

0 comments on commit 4263519

Please sign in to comment.