Merge jv
authorMerge Script
Fri, 25 Mar 2016 06:53:52 +0100
branchjv
changeset 315 bba470ae763f
parent 313 9c15d2d4d8e2 (diff)
parent 314 8247a65b0d86 (current diff)
child 317 a4b0b75a7a51
Merge
--- a/reports/Builder__TestReport.st	Thu Mar 24 14:54:16 2016 +0100
+++ b/reports/Builder__TestReport.st	Fri Mar 25 06:53:52 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'
@@ -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 24 14:54:16 2016 +0100
+++ b/reports/Builder__TestReportFormat.st	Fri Mar 25 06:53:52 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	Thu Mar 24 14:54:16 2016 +0100
+++ b/reports/Make.proto	Fri Mar 25 06:53:52 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	Thu Mar 24 14:54:16 2016 +0100
+++ b/reports/bc.mak	Fri Mar 25 06:53:52 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	Thu Mar 24 14:54:16 2016 +0100
+++ b/reports/bmake.bat	Fri Mar 25 06:53:52 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	Thu Mar 24 14:54:16 2016 +0100
+++ b/reports/stx_goodies_builder_reports.st	Fri Mar 25 06:53:52 2016 +0100
@@ -197,6 +197,10 @@
     ^ '$Header$'
 !
 
+version_HG
+    ^ '$Changeset: <not expanded> $'
+!
+
 version_SVN
     ^ '$Id$'
 ! !
--- a/reports/vcmake.bat	Thu Mar 24 14:54:16 2016 +0100
+++ b/reports/vcmake.bat	Fri Mar 25 06:53:52 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% %*
 
 
 
-