From b36bc57a37bde111fb57e3b1ef184b5ec28e1d93 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Mon, 3 Feb 2014 13:17:16 +0100 Subject: [PATCH] configurable debug level by env variable DEBUG, e.g. $ DEBUG=2 make phantomjs --- test/phantom/evaluate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/phantom/evaluate.js b/test/phantom/evaluate.js index 52e044d..27a2d71 100644 --- a/test/phantom/evaluate.js +++ b/test/phantom/evaluate.js @@ -26,7 +26,10 @@ page.viewportSize = { // 0: silent, 1: some infos, 2: display console.log() output var debug = 2; - +if (system.env['DEBUG'] != 'undefined' && parseInt(system.env['DEBUG']) != NaN) { + debug = system.env['DEBUG']; + if (debug > 0) console.log("reset debug level to: " + debug); +} /************************/ @@ -103,6 +106,7 @@ page.open(url, function (status) { function (result) { if (debug < 1) return; + console.log(""); console.log("MKWS tests are successfully done in " + result.time / 1000 + " seconds. Hooray!"); console.log("jasmine duration: " + result.duration); console.log("jasmine passing: " + result.passing); -- 1.7.10.4