Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
66a880f9
...
66a880f9d31607afd92142549ebddde479a6a461
authored
2012-01-15 08:55:38 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
better exit status code handling on failed test suite
1 parent
3ffc42fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
modules/tester.js
tests/run.js
modules/tester.js
View file @
66a880f
...
...
@@ -433,6 +433,7 @@ var Tester = function(casper, options) {
this
.
renderResults
=
function
renderResults
(
exit
,
status
,
save
)
{
save
=
utils
.
isString
(
save
)
?
save
:
this
.
options
.
save
;
var
total
=
this
.
testResults
.
passed
+
this
.
testResults
.
failed
,
statusText
,
style
,
result
;
var
exitStatus
=
~~
(
status
||
(
this
.
testResults
.
failed
>
0
?
1
:
0
));
if
(
total
===
0
)
{
statusText
=
this
.
options
.
failText
;
style
=
'RED_BAR'
;
...
...
@@ -461,7 +462,8 @@ var Tester = function(casper, options) {
}
}
if
(
exit
===
true
)
{
casper
.
exit
(
status
||
(
this
.
testResults
.
failed
>
0
?
1
:
0
));
console
.
log
(
'exiting with status: '
+
exitStatus
);
casper
.
exit
(
~~
exitStatus
);
}
};
...
...
@@ -494,7 +496,7 @@ var Tester = function(casper, options) {
return
;
}
if
(
current
===
testFiles
.
length
)
{
self
.
renderResults
(
true
);
self
.
emit
(
'tests.complete'
);
clearInterval
(
interval
);
}
else
{
self
.
runTest
(
testFiles
[
current
]);
...
...
tests/run.js
View file @
66a880f
...
...
@@ -29,4 +29,8 @@ if (casper.cli.args.length) {
casper
.
exit
(
1
);
}
casper
.
test
.
on
(
'tests.complete'
,
function
()
{
this
.
renderResults
(
true
);
});
casper
.
test
.
runSuites
.
apply
(
casper
.
test
,
tests
);
...
...
Please
register
or
sign in
to post a comment