--- a/reports/Builder__TestReport.st Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/Builder__TestReport.st Fri Apr 01 06:37:55 2016 +0200
@@ -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'
@@ -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
--- a/reports/Builder__TestReportFormat.st Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/Builder__TestReportFormat.st Fri Apr 01 06:37:55 2016 +0200
@@ -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 Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/Make.proto Fri Apr 01 06:37:55 2016 +0200
@@ -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 Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/bc.mak Fri Apr 01 06:37:55 2016 +0200
@@ -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 Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/bmake.bat Fri Apr 01 06:37:55 2016 +0200
@@ -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 Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/stx_goodies_builder_reports.st Fri Apr 01 06:37:55 2016 +0200
@@ -197,6 +197,10 @@
^ '$Header$'
!
+version_HG
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id$'
! !
--- a/reports/vcmake.bat Thu Mar 31 23:58:20 2016 +0200
+++ b/reports/vcmake.bat Fri Apr 01 06:37:55 2016 +0200
@@ -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% %*
-