reports/Builder__ReportRunner.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:54:38 +0100
changeset 542 aa25a71be62a
parent 243 625f6907682a
permissions -rw-r--r--
#DOCUMENTATION by cg class: stx_goodies_builder_quickSelfTest class definition class: stx_goodies_builder_quickSelfTest class added:18 methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/builder/reports' }"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Builder }"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
StandaloneStartup subclass:#ReportRunner
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:''
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'Builder-Reports'
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    12
ReportRunner class instanceVariableNames:'parser report debugging setup teardown ident'
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
 The following class instance variables are inherited by this class:
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
	StandaloneStartup - MutexHandle
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    18
	Object - 
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
!ReportRunner class methodsFor:'initialization'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
initialize
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
    super initialize.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    debugging := Transcript notNil and:[Transcript isView].
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
    29
    self setupSignalHandlers.
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
    "Created: / 06-11-2011 / 22:07:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
    32
    "Modified: / 28-06-2013 / 01:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
!ReportRunner class methodsFor:'command line options'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    37
cmdlineOptionIdent
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    38
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    39
    ^CmdLineOption new
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    40
        short: $i;
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    41
        long: 'ident';
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    42
        description: 'run/configuration identification';
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    43
        action:[:option |
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    44
            ident := option.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    45
        ];
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    46
        yourself
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    47
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    48
    "Created: / 22-01-2014 / 10:00:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    49
!
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    50
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
cmdlineOptionOutputDirectory
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
    ^CmdLineOption new
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
        short: $D;
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
        long: 'output-directory';
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
        description: 'Default report output directory';
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
    57
        action:[:outputdir |
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
            Report outputDir: outputdir.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
            self  verboseInfo:'Report dir: ' , Report outputDir asString.
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    60
        ];
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    61
        yourself
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
    "Created: / 06-11-2011 / 09:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    64
    "Modified: / 22-01-2014 / 10:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
cmdlineOptionReport
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
    ^CmdLineOption new
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
        short: $r;
97
c6a5d1c4df41 changed: #cmdlineOptionReport
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 92
diff changeset
    71
        long: 'report';
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
        description: 'Report to run';
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
        action:[:option |
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
            report := Smalltalk at: option asSymbol.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
            report isNil ifTrue:[
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
    76
                Stderr nextPutLine:('ERROR: Report class %1 does not exist (forgot to load package?)' bindWith: option).
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
    77
                "/Smalltalk exit: 1.
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
            ].
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
            report := report new.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
            parser options addAll: (CmdLineOption optionsFor: report)
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    81
        ];
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    82
        yourself
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
    "Created: / 06-11-2011 / 09:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    85
    "Modified: / 22-01-2014 / 10:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    86
!
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    87
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    88
cmdlineOptionSetup
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    89
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    90
    ^CmdLineOption new
225
07dd0c1e4e6d Fixed setup option, meant to be -S
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 217
diff changeset
    91
        short: $S;
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    92
        long: 'setup';
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    93
        description: 'Code executed before tests are loaded and executed';
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
    94
        action:[:option |
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    95
            setup := option
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    96
        ];
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    97
        yourself
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    98
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
    99
    "Created: / 15-05-2013 / 16:50:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
225
07dd0c1e4e6d Fixed setup option, meant to be -S
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 217
diff changeset
   100
    "Modified: / 24-01-2014 / 15:26:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   101
!
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   102
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   103
cmdlineOptionTeardown
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   104
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   105
    ^CmdLineOption new
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   106
        short: $T;
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   107
        long: 'teardown';
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   108
        description: 'Code executed after all tests are executed';
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   109
        action:[:option |
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   110
            teardown := option
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   111
        ];
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   112
        yourself
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   113
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   114
    "Created: / 15-05-2013 / 16:50:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   115
    "Modified: / 22-01-2014 / 10:01:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   118
!ReportRunner class methodsFor:'debugging'!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   119
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   120
dumpProcess: aProcess
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   121
    Stderr cr; cr
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   122
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   123
    "Created: / 27-06-2013 / 23:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   124
!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   125
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   126
dumpProcess: aProcess on: aStream
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   127
    | ctx |
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   128
    aStream cr; cr.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   129
    aStream nextPutAll: '== ['; nextPutAll: aProcess id printString; nextPutAll:'] '; nextPutAll: aProcess name; nextPutAll: ' =='; cr.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   130
    aStream cr.
238
c5047b0ed211 Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 232
diff changeset
   131
    aStream nextPutAll: '  State:   '; nextPutAll: aProcess state printString; cr.
c5047b0ed211 Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 232
diff changeset
   132
    aStream nextPutAll: '  Group:   '; nextPutAll: aProcess processGroupId printString; cr.
c5047b0ed211 Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 232
diff changeset
   133
    aStream nextPutAll: '  Creator: '; nextPutAll: aProcess processGroupId printString; cr.
c5047b0ed211 Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 232
diff changeset
   134
    aStream nextPutAll: '  Stack:   '; cr; cr.
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   135
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   136
    aProcess == Processor activeProcess ifTrue:[ctx := thisContext] ifFalse:[ctx := aProcess suspendedContext].
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   137
    [ ctx notNil ] whileTrue:[
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   138
        aStream nextPutAll: '  '.
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   139
        ctx fullPrintOn: aStream.
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   140
        aStream cr.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   141
        ctx := ctx sender.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   142
    ].
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   143
    aStream cr.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   144
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   145
    "
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   146
        self dumpProcess: Processor activeProcess on: Transcript.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   147
    "
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   148
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   149
    "Created: / 28-06-2013 / 01:00:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
238
c5047b0ed211 Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 232
diff changeset
   150
    "Modified: / 06-06-2014 / 09:14:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   151
!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   152
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   153
dumpProcesses
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   154
    self dumpProcessesOn: Stderr
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   155
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   156
    "
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   157
    self dumpProcessesOn: Transcript.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   158
    "
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   159
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   160
    "Created: / 27-06-2013 / 23:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   161
    "Modified (comment): / 28-06-2013 / 01:06:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   162
!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   163
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   164
dumpProcessesOn: aStream
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   165
    Process allInstancesDo:[:process|
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   166
        process isDead ifFalse:[
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   167
            self dumpProcess: process on: aStream
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   168
        ]
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   169
    ]
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   170
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   171
    "Created: / 27-06-2013 / 23:42:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   172
! !
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   173
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
!ReportRunner class methodsFor:'defaults'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   176
allowCoverageMeasurementOption
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   177
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   178
    ^false "CoverageReport will do that"
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   179
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   180
    "Created: / 13-01-2012 / 11:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   181
!
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   182
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
allowDebugOption
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
    ^true
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
    "Created: / 21-07-2011 / 09:48:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   188
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   189
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
!ReportRunner class methodsFor:'multiple applications support'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
applicationRegistryPath
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
    "the key under which this application stores its process ID in the registry
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
     as a collection of path-components.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
     i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
     in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
     (would also be used as a relative path for a temporary lock file under unix).
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
     Used to detect if another instance of this application is already running."
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
    ^ #('exept' 'smalltallx' 'hdreportrunner')
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
    "Modified: / 21-07-2011 / 09:43:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
applicationUUID
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
    "answer an application-specific unique uuid.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
     This is used as the name of some exclusive OS-resource, which is used to find out,
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
     if another instance of this application is already running.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   209
     Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used."
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
    ^ '99f65c80-b375-11e0-86ad-0013e89c0459' asUUID
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
    "Modified: / 21-07-2011 / 09:44:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
!ReportRunner class methodsFor:'startup'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   218
handleSIGTERM
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   219
    self dumpProcesses.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   220
    debugging ifFalse:[
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   221
        Smalltalk exit:127.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   222
    ].
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   223
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   224
    "Created: / 27-06-2013 / 23:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   225
    "Modified: / 28-06-2013 / 01:08:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   226
!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   227
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   228
handleSIGUSR2
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   229
    self dumpProcesses
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   230
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   231
    "Created: / 27-06-2013 / 23:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   232
!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   233
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   234
setupSignalHandlers
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   235
    "On UNIX, this sets up a custom signal handler on SIGUSR2 and SIGTERM that
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   236
     dumps stacks on all threads"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   237
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   238
    | sigusr2 sigterm |
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   239
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   240
    OperatingSystem isUNIXlike ifTrue:[
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   241
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   242
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   243
        sigterm := Signal new.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   244
        sigterm handlerBlock: [:ex | self handleSIGTERM].
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   245
        OperatingSystem operatingSystemSignal:OperatingSystem sigTERM install: sigterm.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   246
        OperatingSystem enableSignal: OperatingSystem sigTERM.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   247
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   248
        sigusr2 := Signal new.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   249
        sigusr2 handlerBlock: [:ex | self handleSIGUSR2].
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   250
        OperatingSystem operatingSystemSignal:OperatingSystem sigUSR2 install: sigusr2.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   251
        OperatingSystem enableSignal: OperatingSystem sigUSR2.
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   252
    ].
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   253
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   254
    "
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   255
    OperatingSystem sendSignal: OperatingSystem sigUSR2 to: OperatingSystem getProcessId
184
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   256
    "
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   257
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   258
    "Created: / 27-06-2013 / 20:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   259
    "Modified: / 28-06-2013 / 01:11:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   260
!
5f75ffc9642b Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 147
diff changeset
   261
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
setupToolsForDebug
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
    super setupToolsForDebug.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
    debugging := true.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   266
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   267
    "Created: / 06-11-2011 / 22:06:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   268
!
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   269
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   270
start
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   271
    Smalltalk silentLoading: true.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   272
    ^ super start.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   273
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   274
    "Created: / 22-01-2014 / 09:17:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   275
!
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   276
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   277
usage
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   278
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   279
    Stderr nextPutAll:'usage: report-runner.';
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   280
           nextPutAll: (OperatingSystem isMSWINDOWSlike ifTrue:['bat'] ifFalse:['sh']);
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   281
           nextPutAll: ' [-D <dir>] -r <report> [-p <package1> [-p <package2> [...]]]'; cr.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   282
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   283
    Stderr nextPutLine:'Common options:'; cr.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   284
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   285
    Stderr nextPutLine:'  --help .................. output this message'.
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   286
"/    Stderr nextPutLine:'  --verbose ............... verbose startup'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   287
"/    Stderr nextPutLine:'  --noBanner .............. no splash screen'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   288
"/    Stderr nextPutLine:'  --newAppInstance ........ start as its own application process (do not reuse'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   289
"/    Stderr nextPutLine:'                            a running instance)'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   290
"/    self allowScriptingOption ifTrue:[
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   291
"/        Stderr nextPutLine:'  --scripting portNr ...enable scripting via port (or stdin/stdOut if 0)'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   292
"/    ].
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   293
    self allowDebugOption ifTrue:[
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   294
        Stderr nextPutLine:'  --debug ................. enable Debugger'.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   295
    ].
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   296
    "/                 '  ......................... '
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   297
    Stderr nextPutLine:'  -D <dir>'.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   298
    Stderr nextPutLine:'  --output-directory=<dir>  directory where report files will go'.
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   299
    Stderr nextPutLine:'  -S <expr>'.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   300
    Stderr nextPutLine:'  --setup=<expr> .......... smalltalk expression that is evaluated before'. 
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   301
    Stderr nextPutLine:'                            any report is run'.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   302
    Stderr nextPutLine:'  -T <expr>'.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   303
    Stderr nextPutLine:'  --teardown=<expr> ....... smalltalk expression that is evaluated before'. 
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   304
    Stderr nextPutLine:'                            after all reports finished'.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   305
    Stderr nextPutLine:'  -i <ident>'.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   306
    Stderr nextPutLine:'  --ident=<ident> ......... run/configuration identification string to'.
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   307
    Stderr nextPutLine:'                            use when creating output files'.
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   308
    Stderr nextPutLine:'  -r <report class>'.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   309
    Stderr nextPutLine:'  --report=<report class> . report to run. available reports:'.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   310
    Report available do:[:report|
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   311
        Stderr nextPutAll:'      '; nextPutLine: report name
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   312
    ].
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   313
    Stderr nextPutLine:'  -p <package>'.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   314
    Stderr nextPutLine:'  --package=<package> ..... package to run report on'.
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   315
    Stderr nextPutLine:'                            May be specified multiple times.'.
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   316
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   317
    Report available do:[:cls|
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   318
        self usageForReportClass: cls.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   319
    ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   320
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   321
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   322
    debugging ifFalse:[
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   323
        Smalltalk exit:1.
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   324
    ].
77
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   325
    "
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   326
    self usage
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   327
    "
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   328
90d1dd533087 --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
   329
    "Created: / 13-01-2012 / 11:48:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   330
    "Modified: / 27-05-2014 / 17:02:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   331
!
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   332
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   333
usageForReportClass: class
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   334
    | options |
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   335
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   336
    "/ '.........................' size  25
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   337
    options := CmdLineOption optionsFor: class new.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   338
    options := options reject:[:option | 'pF' includes: option short  ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   339
    options notEmptyOrNil ifTrue:[
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   340
        Stderr cr.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   341
        Stderr nextPutAll: class name; nextPutLine:' options:'; cr.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   342
        options do:[:option |                
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   343
            | optlen |  
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   344
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   345
            option short notNil ifTrue:[ 
243
625f6907682a Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
   346
                Stderr nextPutAll: '  '.
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   347
                Stderr nextPut: $-; nextPut: option short; space.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   348
                optlen := 2.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   349
                option hasParam ifTrue:[ 
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   350
                    | paramName |
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   351
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   352
                    paramName := 'val'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   353
                    Stderr nextPut:$<; nextPutAll: paramName; nextPut:$>; space.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   354
                    optlen := optlen + 3 + paramName size.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   355
                ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   356
            ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   357
            option long notNil ifTrue:[ 
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   358
                 option short notNil ifTrue:[ 
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   359
                    Stderr cr.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   360
                ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   361
                Stderr nextPutAll: '  --'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   362
                Stderr nextPutAll: option long.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   363
                optlen := option long size + 2.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   364
                option hasParam ifTrue:[ 
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   365
                    | paramName |
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   366
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   367
                    paramName := 'val'.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   368
                    Stderr nextPut:$=; nextPut:$<; nextPutAll: paramName; nextPut:$>.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   369
                    optlen := optlen + 3 + paramName size.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   370
                ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   371
                Stderr space.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   372
            ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   373
            Stderr next: (26 - 1"space" -2"--" - optlen) put: $..    
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   374
            Stderr space.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   375
            option description notNil ifTrue:[
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   376
                Stderr nextPutAll: option description
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   377
            ].
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   378
            Stderr cr.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   379
        ]
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   380
    ]
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   381
243
625f6907682a Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
   382
    "
625f6907682a Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
   383
    ReportRunner usageForReportClass: TestReport.
625f6907682a Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
   384
    "
625f6907682a Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
   385
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   386
    "Created: / 27-05-2014 / 16:42:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
243
625f6907682a Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
   387
    "Modified: / 16-06-2014 / 11:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   388
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   389
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   390
!ReportRunner class methodsFor:'startup-to be redefined'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   391
189
bd2bed33aba7 Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 188
diff changeset
   392
main:argv0
143
252c91b7f96d class: Builder::ReportRunner
Stefan Vogel <sv@exept.de>
parents: 102
diff changeset
   393
    "Process command line arguments"
102
a63aa44303e3 changed: #main: - support for not-officially-supported VM options
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 97
diff changeset
   394
189
bd2bed33aba7 Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 188
diff changeset
   395
    | argv |
bd2bed33aba7 Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 188
diff changeset
   396
bd2bed33aba7 Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 188
diff changeset
   397
    argv := argv0 asOrderedCollection.
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   398
    argv isEmpty ifTrue:[ 
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   399
        self usage.
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   400
    ].
189
bd2bed33aba7 Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 188
diff changeset
   401
    argv remove: '--abortOnSEGV' ifAbsent:[nil].
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   402
    parser := CmdLineParser new.
144
b38e5af6b408 class: Builder::ReportRunner
Stefan Vogel <sv@exept.de>
parents: 143
diff changeset
   403
    CmdLineOptionError autoload.
b38e5af6b408 class: Builder::ReportRunner
Stefan Vogel <sv@exept.de>
parents: 143
diff changeset
   404
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   405
    [
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   406
        parser parse: argv for: self.
143
252c91b7f96d class: Builder::ReportRunner
Stefan Vogel <sv@exept.de>
parents: 102
diff changeset
   407
    ] on:CmdLineOptionError do:[:ex|
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   408
        Stderr nextPutLine:'Error when processing options: ', ex description.
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   409
        debugging ifFalse:[
92
545ea8f561b0 changed: #main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   410
            ex suspendedContext fullPrintAllOn: Stderr.
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   411
            Stderr nextPutLine:'Exiting'.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   412
            Smalltalk exit:1.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   413
        ] ifTrue:[
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   414
            ex pass
188
6eeac31d0432 Workaround for stc bug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 184
diff changeset
   415
        ]
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   416
    ].
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   417
230
9e0098682d8c Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   418
    debugging ifFalse:[ 
9e0098682d8c Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   419
        NoHandlerError emergencyHandler:(NoHandlerError abortingEmergencyHandler)
9e0098682d8c Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   420
    ].
9e0098682d8c Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   421
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   422
    [
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   423
        setup notNil ifTrue:[Compiler evaluate: setup].
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   424
        [
217
054062587f02 Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
   425
            report ident: ident.
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   426
            report run.
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   427
        ] ensure:[
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   428
            teardown notNil ifTrue:[Compiler evaluate: teardown].
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   429
        ].
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   430
        debugging ifFalse:[
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   431
            Smalltalk exit:0.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   432
        ].
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   433
    ] on: Error do:[:ex|
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   434
        Stderr nextPutAll:'Error when running tests: '.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   435
        Stderr nextPutAll:ex description; cr.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   436
        ex suspendedContext printAllOn:Stderr.
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   437
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   438
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   439
        debugging ifFalse:[
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   440
            Smalltalk exit:1.
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   441
        ] ifTrue:[
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   442
            ex pass
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   443
        ]
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   444
    ]
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   445
232
3c3f5f58ddeb Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 230
diff changeset
   446
    "Modified: / 27-05-2014 / 17:05:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   447
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   448
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   449
!ReportRunner class methodsFor:'documentation'!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   450
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   451
version
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   452
    ^ '$Header$'
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   453
!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   454
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   455
version_CVS
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   456
    ^ '$Header$'
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   457
!
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   458
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   459
version_SVN
147
9f2935d68582 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 144
diff changeset
   460
    ^ '$Id$'
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   461
! !
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   462
143
252c91b7f96d class: Builder::ReportRunner
Stefan Vogel <sv@exept.de>
parents: 102
diff changeset
   463
72
c23d29fe0ec6 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   464
ReportRunner initialize!