class: Builder::ReportRunner
class definition
added:
#cmdlineOptionSetup
#cmdlineOptionTeardown
changed: #main:
--- a/reports/Builder__ReportRunner.st Fri Apr 26 18:01:50 2013 +0200
+++ b/reports/Builder__ReportRunner.st Wed May 15 18:00:14 2013 +0200
@@ -9,7 +9,7 @@
category:'Builder-Reports'
!
-ReportRunner class instanceVariableNames:'parser report debugging'
+ReportRunner class instanceVariableNames:'parser report debugging setup teardown'
"
The following class instance variables are inherited by this class:
@@ -64,6 +64,32 @@
"Created: / 06-11-2011 / 09:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 31-10-2012 / 12:40:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+cmdlineOptionSetup
+
+ ^CmdLineOption new
+ short: $s;
+ long: 'setup';
+ description: 'Code executed before tests are loaded and executed';
+ action:[:option |
+ setup := option
+ ]
+
+ "Created: / 15-05-2013 / 16:50:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+cmdlineOptionTeardown
+
+ ^CmdLineOption new
+ short: $t;
+ long: 'setup';
+ description: 'Code executed after all tests are executed';
+ action:[:option |
+ teardown := option
+ ]
+
+ "Created: / 15-05-2013 / 16:50:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!ReportRunner class methodsFor:'defaults'!
@@ -176,7 +202,12 @@
].
[
- report run.
+ setup notNil ifTrue:[Compiler evaluate: setup].
+ [
+ report run.
+ ] ensure:[
+ teardown notNil ifTrue:[Compiler evaluate: teardown].
+ ].
debugging ifFalse:[
Smalltalk exit:0.
].
@@ -184,6 +215,8 @@
Stderr nextPutAll:'Error when running tests: '.
Stderr nextPutAll:ex description; cr.
ex suspendedContext printAllOn:Stderr.
+
+
debugging ifFalse:[
Smalltalk exit:1.
] ifTrue:[
@@ -191,7 +224,7 @@
]
]
- "Modified: / 13-11-2012 / 09:40:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 15-05-2013 / 16:52:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!ReportRunner class methodsFor:'documentation'!
@@ -205,7 +238,7 @@
!
version_SVN
- ^ '§Id: Builder__ReportRunner.st 289 2011-11-10 15:39:10Z vranyj1 §'
+ ^ '$Id$'
! !