scripts and README added
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 13 Jan 2012 12:25:20 +0100
changeset 75 686f675d9442
parent 74 d67d39f7b54e
child 76 4c992db5503a
scripts and README added
reports/README
reports/report-runner.sh
reports/report-runner.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reports/README	Fri Jan 13 12:25:20 2012 +0100
@@ -0,0 +1,26 @@
+This package contains tools to generate various reports.
+Currently, only SUnit test report is supported. Also, options to 
+control what to do are quite limited. More will come...
+
+To run a test suite for a package, execute following command:
+
+../../../projects/smalltalk/stx -I --quick --noBanner -f test-runner.sh \
+	-D <REPORTDIR> -r <REPORT> -p <PACKAGE> [-p <PACKAGE> [-p ... ]]
+
+Where 
+  <REPORTDIR>     is a directory where the report files are stored. 
+                  Currently the name of the file is fixed, being
+                  <PACKAGE>-<KIND>.xml. 
+  <REPORT>        Report class name. Currently, only Builder::TestReport
+                  is supported.
+  <PACKAGE>       Smalltalk/X package name for which to generate the report.
+
+
+Example: 
+
+To run Smalltalk regression tests, issue following command:
+
+../../../projects/smalltalk/stx -I --quick --noBanner  -f test-runner.st \
+	-D /tmp -r Builder::TestReport -p exept:regression
+
+When finished, you may find a report in file  /tmp/exept_regression-Test.xml 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reports/report-runner.sh	Fri Jan 13 12:25:20 2012 +0100
@@ -0,0 +1,3 @@
+#!/bin/sh
+DIR=`dirname $0`
+exec "$DIR/../../../projects/smalltalk/stx" -I  -f "$DIR/report-runner.st" "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reports/report-runner.st	Fri Jan 13 12:25:20 2012 +0100
@@ -0,0 +1,39 @@
+| pp wd i p |
+
+"Search for package path, bit hacky but..."
+wd := Filename currentDirectory.
+pp := nil.
+p := wd.
+i := 10."How many super-directories try"
+[i > 0 and:[pp == nil]] whileTrue:[
+        p := p / '..'. i := i - 1.
+        ((p / 'stx' / 'libbasic') exists and:[(p / 'stx' / 'libcomp') exists])
+                ifTrue:[pp := p]].
+pp
+        ifNil:
+                [Stderr nextPutAll: 'ERROR: Cannot find package path'.
+                Smalltalk exit: 16]
+        ifNotNil:
+                [Smalltalk packagePath add: pp pathName].
+
+(Smalltalk commandLineArguments includes:'--debug') ifTrue:[
+    Stderr nextPutAll:'Package path:'; cr.
+    Smalltalk packagePath do:[:each|
+       Stderr nextPutAll:'  '; nextPutAll: each; cr.
+    ].
+
+	(OperatingSystem getEnvironment: 'DISPLAY') notNil ifTrue:[
+        Smalltalk beHeadless: false.
+	].
+] ifFalse: [
+	Smalltalk beHeadless: true.
+].
+
+(Smalltalk at:#'Builder::ReportRunner') isNil ifTrue:[
+    (Smalltalk loadPackage: 'stx:goodies/builder/reports') ifFalse:[
+        Stderr nextPutAll:'ERROR: cannot load stx:goodies/builder/reports.'.
+        Smalltalk exit: 17
+    ].
+].
+
+Smalltalk addStartBlock:[(Smalltalk at:#'Builder::ReportRunner') start].