From 918dcf6ed2ac7163d8450ca94d3c7946d85276aa Mon Sep 17 00:00:00 2001 From: David Majda Date: Wed, 26 Jan 2011 16:08:03 +0100 Subject: [PATCH] Test and benchmark command-line runners can be run from any directory --- benchmark/run | 4 ++-- test/run | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/run b/benchmark/run index d35bc6f..68e5353 100755 --- a/benchmark/run +++ b/benchmark/run @@ -8,7 +8,7 @@ var PEG = require("../lib/peg"); "benchmarks.js", "runner.js", ].forEach(function(file) { - eval(fs.readFileSync(file, "utf8")); + eval(fs.readFileSync(__dirname + "/" + file, "utf8")); }); /* Results Table Manipulation */ @@ -105,7 +105,7 @@ sys.puts(""); Runner.run(benchmarks, runCount, { readFile: function(file) { - return fs.readFileSync(file, "utf8"); + return fs.readFileSync(__dirname + "/" + file, "utf8"); }, testStart: function(benchmark, test) { diff --git a/test/run b/test/run index b81044a..e8ee09e 100755 --- a/test/run +++ b/test/run @@ -81,7 +81,7 @@ QUnit.done = function(details) { "passes-test.js", "compiler-test.js", ].forEach(function(file) { - eval("with (QUnit) {" + fs.readFileSync(file, "utf8") + "}"); + eval("with (QUnit) {" + fs.readFileSync(__dirname + "/" + file, "utf8") + "}"); }); QUnit.start();