projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/danvk/dygraphs
[dygraphs.git]
/
phantom-driver.js
diff --git
a/phantom-driver.js
b/phantom-driver.js
index
009c634
..
a782100
100644
(file)
--- a/
phantom-driver.js
+++ b/
phantom-driver.js
@@
-22,10
+22,16
@@
page.open(url, function(status) {
}
var testCase, test;
}
var testCase, test;
- if (phantom.args.length == 1) {
- var parts = phantom.args[0].split('.');
+ var verbose = false;
+ var optIdx = 0;
+ if (phantom.args.length > 0 && phantom.args[0] === "--verbose") {
+ verbose = true;
+ optIdx = 1;
+ }
+ if (phantom.args.length == optIdx + 1) {
+ var parts = phantom.args[optIdx].split('.');
if (2 != parts.length) {
if (2 != parts.length) {
- console.warn('Usage: phantomjs phantom-driver.js [testCase.test]');
+ console.warn('Usage: phantomjs phantom-driver.js [
--verbose] [
testCase.test]');
phantom.exit();
}
testCase = parts[0];
phantom.exit();
}
testCase = parts[0];
@@
-39,7
+45,7
@@
page.open(url, function(status) {
} else if (msg.substr(0, 'Running'.length) == 'Running') {
loggingOn = false;
}
} else if (msg.substr(0, 'Running'.length) == 'Running') {
loggingOn = false;
}
- if (loggingOn) console.log(msg);
+ if (
verbose ||
loggingOn) console.log(msg);
};
page.onError = function (msg, trace) {
};
page.onError = function (msg, trace) {
@@
-80,7
+86,7
@@
page.open(url, function(status) {
for (var test in caseResults) {
if (caseResults[test] !== true) {
num_failing++;
for (var test in caseResults) {
if (caseResults[test] !== true) {
num_failing++;
- failures.push(testCase + '.' + test
+ ' failed'
);
+ failures.push(testCase + '.' + test);
} else {
// console.log(testCase + '.' + test + ' passed');
num_passing++;
} else {
// console.log(testCase + '.' + test + ' passed');
num_passing++;
@@
-179,8
+185,9
@@
RunAllAutoTests(function(num_failing, num_passing) {
if (num_failing !== 0) {
console.log('FAIL');
phantom.exit();
if (num_failing !== 0) {
console.log('FAIL');
phantom.exit();
+ } else {
+ console.log('PASS');
}
}
- console.log('PASS');
phantom.exit();
// This is not yet reliable enough to be useful:
phantom.exit();
// This is not yet reliable enough to be useful: