reports/Builder__ReportRunner.st
changeset 217 054062587f02
parent 189 bd2bed33aba7
child 225 07dd0c1e4e6d
--- a/reports/Builder__ReportRunner.st	Wed Nov 27 02:25:29 2013 +0100
+++ b/reports/Builder__ReportRunner.st	Wed Jan 22 12:21:04 2014 +0100
@@ -9,13 +9,13 @@
 	category:'Builder-Reports'
 !
 
-ReportRunner class instanceVariableNames:'parser report debugging setup teardown'
+ReportRunner class instanceVariableNames:'parser report debugging setup teardown ident'
 
 "
  The following class instance variables are inherited by this class:
 
 	StandaloneStartup - MutexHandle
-	Object -
+	Object - 
 "
 !
 
@@ -34,6 +34,20 @@
 
 !ReportRunner class methodsFor:'command line options'!
 
+cmdlineOptionIdent
+
+    ^CmdLineOption new
+        short: $i;
+        long: 'ident';
+        description: 'run/configuration identification';
+        action:[:option |
+            ident := option.
+        ];
+        yourself
+
+    "Created: / 22-01-2014 / 10:00:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 cmdlineOptionOutputDirectory
 
     ^CmdLineOption new
@@ -43,9 +57,11 @@
         action:[:outputdir |
             Report outputDir: outputdir.
             self  verboseInfo:'Report dir: ' , Report outputDir asString.
-        ]
+        ];
+        yourself
 
     "Created: / 06-11-2011 / 09:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-01-2014 / 10:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cmdlineOptionReport
@@ -62,10 +78,11 @@
             ].
             report := report new.
             parser options addAll: (CmdLineOption optionsFor: report)
-        ]
+        ];
+        yourself
 
     "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>"
+    "Modified: / 22-01-2014 / 10:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cmdlineOptionSetup
@@ -76,22 +93,26 @@
         description: 'Code executed before tests are loaded and executed';
         action:[:option |
             setup := option
-        ]
+        ];
+        yourself
 
     "Created: / 15-05-2013 / 16:50:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-01-2014 / 10:00:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cmdlineOptionTeardown
 
     ^CmdLineOption new
-        short: $t;
-        long: 'setup';
+        short: $T;
+        long: 'teardown';
         description: 'Code executed after all tests are executed';
         action:[:option |
             teardown := option
-        ]
+        ];
+        yourself
 
     "Created: / 15-05-2013 / 16:50:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-01-2014 / 10:01:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ReportRunner class methodsFor:'debugging'!
@@ -241,6 +262,13 @@
     "Created: / 06-11-2011 / 22:06:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+start
+    Smalltalk silentLoading: true.
+    ^ super start.
+
+    "Created: / 22-01-2014 / 09:17:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 usage
 
     Stderr nextPutAll:'usage: report-runner.';
@@ -250,9 +278,10 @@
     Stderr nextPutLine:'  --help .................. output this message'.
     Stderr nextPutLine:'  --verbose ............... verbose startup'.
     Stderr nextPutLine:'  --noBanner .............. no splash screen'.
-    Stderr nextPutLine:'  --newAppInstance ........ start as its own application process (do not reuse a running instance)'.
+    Stderr nextPutLine:'  --newAppInstance ........ start as its own application process (do not reuse'.
+    Stderr nextPutLine:'                            a running instance)'.
     self allowScriptingOption ifTrue:[
-        Stderr nextPutLine:'  --scripting portNr ...... enable scripting via port (or stdin/stdOut, if 0)'.
+        Stderr nextPutLine:'  --scripting portNr ...enable scripting via port (or stdin/stdOut if 0)'.
     ].
     self allowDebugOption ifTrue:[
         Stderr nextPutLine:'  --debug ................. enable Debugger'.
@@ -261,6 +290,15 @@
     "/                 '  ......................... '
     Stderr nextPutLine:'  -D <dir>'.
     Stderr nextPutLine:'  --output-directory=<dir>  directory where report files will go'.
+    Stderr nextPutLine:'  -S <expr>'.
+    Stderr nextPutLine:'  --setup=<expr> .......... smalltalk expression that is evaluated before'. 
+    Stderr nextPutLine:'                            any report is run'.
+    Stderr nextPutLine:'  -T <expr>'.
+    Stderr nextPutLine:'  --teardown=<expr> ....... smalltalk expression that is evaluated before'. 
+    Stderr nextPutLine:'                            after all reports finished'.
+    Stderr nextPutLine:'  -i <ident>'.
+    Stderr nextPutLine:'  --ident=<ident> ......... run/configuration identification string to'.
+    Stderr nextPutLine:'                            use when creating output files'.
     Stderr nextPutLine:'  -r <report class>'.
     Stderr nextPutLine:'  --report=<report class> . report to run. available reports:'.
     Report available do:[:report|
@@ -269,12 +307,15 @@
     Stderr nextPutLine:'  -p <package>'.
     Stderr nextPutLine:'  --package=<package> ..... package to run report on'.
     Stderr nextPutLine:'                            May be specified multiple times.'.
-
+    debugging ifTrue:[
+        Smalltalk exit:1.
+    ]
     "
     self usage
     "
 
     "Created: / 13-01-2012 / 11:48:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-01-2014 / 09:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ReportRunner class methodsFor:'startup-to be redefined'!
@@ -305,6 +346,7 @@
     [
         setup notNil ifTrue:[Compiler evaluate: setup].
         [
+            report ident: ident.
             report run.
         ] ensure:[
             teardown notNil ifTrue:[Compiler evaluate: teardown].
@@ -325,7 +367,7 @@
         ]
     ]
 
-    "Modified: / 15-05-2013 / 16:52:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-01-2014 / 10:01:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ReportRunner class methodsFor:'documentation'!