reports/report-runner.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:54:38 +0100
changeset 542 aa25a71be62a
parent 189 bd2bed33aba7
child 327 113031dfa759
permissions -rw-r--r--
#DOCUMENTATION by cg
class: stx_goodies_builder_quickSelfTest
class definition

class: stx_goodies_builder_quickSelfTest class
added:18 methods
     1 | pp wd i p |
     2 
     3 "Search for package path, bit hacky but..."
     4 wd := Filename currentDirectory.
     5 pp := nil.
     6 p := wd.
     7 i := 10."How many super-directories try"
     8 [i > 0 and:[pp == nil]] whileTrue:[
     9         p := p / '..'. i := i - 1.
    10         ((p / 'stx' / 'libbasic') exists and:[(p / 'stx' / 'libcomp') exists])
    11                 ifTrue:[pp := p]].
    12 pp
    13         ifNil:
    14                 [Stderr nextPutAll: 'ERROR: Cannot find package path'.
    15                 Smalltalk exit: 16]
    16         ifNotNil:
    17                 [Smalltalk packagePath add: pp pathName].
    18 
    19 (Smalltalk commandLineArguments includes:'--debug') ifTrue:[
    20     Stderr nextPutAll:'Package path:'; cr.
    21     Smalltalk packagePath do:[:each|
    22        Stderr nextPutAll:'  '; nextPutAll: each; cr.
    23     ].
    24 
    25     Smalltalk beHeadless: (OperatingSystem getEnvironment: 'DISPLAY') isNil.
    26 ] ifFalse: [
    27 	Smalltalk beHeadless: true.
    28 ].
    29 
    30 (Smalltalk at:#'Builder::ReportRunner') isNil ifTrue:[
    31     (Smalltalk loadPackage: 'stx:goodies/sunit') ifFalse:[
    32         Stderr nextPutAll:'ERROR: cannot load stx:goodies/sunit.'.
    33         Smalltalk exit: 17
    34     ].
    35     (Smalltalk loadPackage: 'stx:goodies/builder/reports') ifFalse:[
    36         Stderr nextPutAll:'ERROR: cannot load stx:goodies/builder/reports.'.
    37         Smalltalk exit: 17
    38     ].
    39 ].
    40 
    41 (Smalltalk at:#'Builder::ReportRunner') start.