--- a/reports/Builder__TestReport.st Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/Builder__TestReport.st Mon Dec 05 06:48:09 2016 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Builder }"
Report subclass:#TestReport
- instanceVariableNames:'suite coverage instrument keepStdout'
+ instanceVariableNames:'suite coverage instrument keepStdout keepBytecode'
classVariableNames:''
poolDictionaries:''
category:'Builder-Reports'
@@ -11,7 +11,7 @@
TestResult subclass:#Result
instanceVariableNames:'format time npassed nfailed nerror nskipped collector'
- classVariableNames:''
+ classVariableNames:'TimeoutScale'
poolDictionaries:''
privateIn:TestReport
!
@@ -19,6 +19,14 @@
!TestReport methodsFor:'accessing'!
+keepBytecode
+ ^ keepBytecode
+!
+
+keepBytecode:aBoolean
+ keepBytecode := aBoolean.
+!
+
keepStdout
^ keepStdout
!
@@ -111,6 +119,18 @@
"Created: / 27-05-2014 / 16:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+cmdlineOptionKeepBytecode
+
+ ^CmdLineOption new
+ long: 'keep-bytecode';
+ description: 'Keep and include method''s bytecode in reported stacktraces. May generate huge report!!';
+ action:[
+ keepBytecode := true
+ ]
+
+ "Created: / 15-03-2016 / 14:32:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
cmdlineOptionKeepStdout
^CmdLineOption new
@@ -228,6 +248,7 @@
Transcript cr; cr.
Transcript show: 'COLLECTING COVERAGE...'.
coverage name: self name.
+ coverage ident: self ident.
coverage run.
] ifFalse:[
suite run:result.
@@ -250,7 +271,7 @@
Transcript cr.
"Created: / 04-08-2011 / 12:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 23-10-2013 / 11:48:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 28-05-2016 / 10:33:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TestReport::Result methodsFor:'accessing'!
@@ -359,9 +380,16 @@
initialize
super initialize.
- npassed := nfailed := nerror := nskipped := 0
+ npassed := nfailed := nerror := nskipped := 0.
+ TimeoutScale isNil ifTrue:[
+ | bench |
+
+ bench := Time millisecondsToRun:[3000 timesRepeat: [ 2000 factorial ]].
+ TimeoutScale := (bench / 2500"mean value of an i5 32bit") max: 1.
+ ].
"Created: / 31-01-2013 / 13:52:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 14-11-2016 / 23:37:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TestReport::Result methodsFor:'running'!
@@ -460,11 +488,12 @@
!TestReport::Result methodsFor:'running-private'!
-lightForkCase:aTestCase debugged: debugged timeout: timeout
- | thread sema stime etime timeouted error stack log logPos |
+lightForkCase:aTestCase debugged: debugged timeout: timeoutBase
+ | timeout thread sema stime etime timeouted error stack log logPos |
Logger trace: 'Running %1>>%2' with: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport.
Transcript show:'F'.
+ timeout := (timeoutBase * TimeoutScale) rounded.
sema := Semaphore new.
stime := OperatingSystem getMillisecondTime.
log := false.
@@ -486,7 +515,7 @@
etime := OperatingSystem getMillisecondTime.
timeouted ifTrue:[
- error := TimeoutError new messageText: 'Timed out'.
+ error := TimeoutError new messageText: ('Timed out (effective %1ms, base %2ms, scale %3)' bindWith: timeout with: timeoutBase with:TimeoutScale) .
outcome result: TestResult stateError.
format
writeTestCase: aTestCase outcome: outcome
@@ -501,13 +530,14 @@
Transcript cr.
"Created: / 12-01-2012 / 17:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 29-10-2014 / 13:59:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 16-11-2016 / 23:26:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-unixForkCase:aTestCase debugged: debugged timeout: timeout
- | pid status sema stime etime error stack suiteFailuresBefore suiteErrorsBefore log logPos |
+unixForkCase:aTestCase debugged: debugged timeout: timeoutBase
+ | timeout pid status sema stime etime error stack suiteFailuresBefore suiteErrorsBefore log logPos |
Transcript show:'forking...'.
+ timeout := (timeoutBase * TimeoutScale) rounded.
sema := Semaphore new.
stime := OperatingSystem getMillisecondTime.
log := false.
@@ -557,7 +587,7 @@
[ log := true.
status isNil
ifTrue:
- [ error := TimeoutError new parameter:timeout.
+ [ error := TimeoutError new messageText: ('Timed out (effective %1ms, base %2ms, scale %3)' bindWith: timeout with: timeoutBase with:TimeoutScale) .
stack := 'Oops, timed out!! (timeout was ' , timeout printString , ' sec)'. ]
ifFalse:
[ status status == #signal
@@ -594,7 +624,7 @@
Transcript cr.
"Created: / 12-01-2012 / 17:43:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 06-06-2014 / 00:54:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 16-11-2016 / 23:26:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TestReport class methodsFor:'documentation'!
@@ -607,6 +637,11 @@
^ '$Header$'
!
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id$'
! !
--- a/reports/Builder__TestReportFormat.st Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/Builder__TestReportFormat.st Mon Dec 05 06:48:09 2016 +0100
@@ -97,19 +97,24 @@
writeContext: context on: s
- |home mthd src|
+ |home mthd src vars args argAndVarNames |
[
context printOn: s.
s cr.
s nextPutAll:'receiver: '. context receiver printOn: s. s cr.
- s nextPutAll:'selector: '. context selector printOn: s. s cr.
+ s nextPutAll:'selector: '. context selector storeOn: s. s cr.
+
+ args := context args.
+ vars := context vars.
+ argAndVarNames := context argAndVarNames.
s nextPutAll:'args: '; cr.
- context args keysAndValuesDo:[:idx :eachArg |
- s nextPutAll:' '. idx printOn: s. s nextPutAll:': '. eachArg printOn: s.s cr.
+
+ args keysAndValuesDo:[:idx :eachArg |
+ s nextPutAll:' '. idx printOn: s leftPaddedTo:2 . s space. (argAndVarNames at: idx ifAbsent:['']) printOn: s paddedTo:12. s nextPutAll:': '. eachArg printOn: s.s cr.
].
s nextPutAll:'vars: '; cr.
- context vars keysAndValuesDo:[:idx :eachVar |
- s nextPutAll:' '. idx printOn: s. s nextPutAll:': '.
+ vars keysAndValuesDo:[:idx :eachVar |
+ s nextPutAll:' '. idx printOn: s leftPaddedTo:2. s space. (argAndVarNames at: idx + args size ifAbsent:['']) printOn: s paddedTo:12. s nextPutAll:': '.
eachVar isString ifTrue:[
eachVar storeOn: s.
] ifFalse:[
@@ -117,11 +122,27 @@
].
s cr.
].
+ home := context methodHome.
+ mthd := home method.
+
+ report keepBytecode ifTrue:[
+ s nextPutAll:'bytecode: '; cr.
+ mthd notNil ifTrue:[
+ (mthd isJavaMethod and:[mthd class ~~ JavaNativeMethod]) ifFalse:[
+ Decompiler decompile: mthd to: s.
+ ] ifTrue:[
+ (Smalltalk at: #JavaByteCodeDisassembler) notNil ifTrue:[
+ (Smalltalk at: #JavaByteCodeDisassembler) diassemble: mthd to: s.
+ ] ifFalse:[
+ s nextPutAll: ' ** no JavaByteCodeDisassembler **'
+ ].
+ ].
+ ].
+ ].
+
+ s cr.
s nextPutAll:'source: '; cr.
-
[
- home := context methodHome.
- mthd := home method.
mthd isNil ifTrue:[
s nextPutAll: '** no source **'. s cr. s cr.
^ self.
@@ -153,17 +174,21 @@
s cr;
nextPutAll:'!!!!!!ERROR WHEN GETTING STACK TRACE!!!!!!'; cr;
nextPutAll: ex description; cr
- ]
+ ].
+
+ "
+ String streamContents:[ :s | Builder::TestReportFormat basicNew writeContext: thisContext on: s ]
+ "
"Created: / 03-08-2011 / 14:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 15-03-2016 / 14:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
writeStackTrace:err of:aTestCase on: str
- | context stop |
+ | context |
context := err signalerContext.
- stop := false.
[ context notNil ] whileTrue:[
self writeContext: context on: str.
@@ -178,6 +203,7 @@
].
"Created: / 03-08-2011 / 14:53:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 15-03-2016 / 14:33:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TestReportFormat::JUnit class methodsFor:'accessing'!
@@ -701,6 +727,11 @@
^ '$Header$'
!
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id$'
! !
--- a/reports/Make.proto Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/Make.proto Mon Dec 05 06:48:09 2016 +0100
@@ -92,6 +92,13 @@
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
+stx_goodies_builder_reports.$(O): $(shell hg root)/.hg/dirstate
+endif
+
@@ -118,7 +125,6 @@
prereq:
cd ../../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
--- a/reports/bc.mak Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/bc.mak Mon Dec 05 06:48:09 2016 +0100
@@ -53,7 +53,6 @@
prereq:
pushd ..\..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
@@ -90,3 +89,12 @@
$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
+
+# **Must be at end**
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+!IFDEF HGROOT
+$(OUTDIR)stx_goodies_builder_reports.$(O): $(HGROOT)\.hg\dirstate
+!ENDIF
--- a/reports/bmake.bat Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/bmake.bat Mon Dec 05 06:48:09 2016 +0100
@@ -7,6 +7,7 @@
@REM Kludge got Mercurial, cannot be implemented in Borland make
@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+
make.exe -N -f bc.mak %DEFINES% %*
--- a/reports/stx_goodies_builder_reports.st Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/stx_goodies_builder_reports.st Mon Dec 05 06:48:09 2016 +0100
@@ -197,6 +197,10 @@
^ '$Header$'
!
+version_HG
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id$'
! !
--- a/reports/vcmake.bat Wed Nov 09 04:12:36 2016 +0100
+++ b/reports/vcmake.bat Mon Dec 05 06:48:09 2016 +0100
@@ -13,8 +13,9 @@
@REM Kludge got Mercurial, cannot be implemented in Borland make
@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+
+
make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %*
-