class: Tools::TestRunner2
authorClaus Gittinger <cg@exept.de>
Sun, 01 Feb 2015 20:55:31 +0100
changeset 15163 638fc3d975e8
parent 15162 fc14775b60a7
child 15164 0bf39699aad5
class: Tools::TestRunner2 added: #resultListMenuCopyList changed: #resultListMenu added "Copy List" menu item, to paste a testruns output into a documentation text editor.
Tools__TestRunner2.st
--- a/Tools__TestRunner2.st	Sun Feb 01 17:23:47 2015 +0100
+++ b/Tools__TestRunner2.st	Sun Feb 01 20:55:31 2015 +0100
@@ -1010,6 +1010,14 @@
             itemValue: resultListMenuBrowse
             translateLabel: true
           )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Copy List'
+            itemValue: resultListMenuCopyList
+            translateLabel: true
+          )
          )
         nil
         nil
@@ -1536,6 +1544,38 @@
     ].
 
     "Created: / 23-09-2011 / 18:55:50 / cg"
+!
+
+resultListMenuCopyList
+    |rslt passed failures errors text|
+
+    rslt := resultHolder value.  
+    rslt isNil ifTrue:[^ self].
+
+    passed := OrderedCollection new.
+    failures := OrderedCollection new.
+    errors := OrderedCollection new.
+
+    rslt collectAll:[:each |
+        passed addAll:each passed.
+        failures addAll:each failures.
+        errors addAll:each errors.
+    ].
+    text := String streamContents:[:s |
+        s nextPutLine:('errors: %1' bindWith:errors size).
+        errors do:[:each |
+            s spaces:4; nextPutLine:each printString
+        ].
+        s nextPutLine:('failures: %1' bindWith:failures size).
+        failures do:[:each |
+            s spaces:4; nextPutLine:each printString
+        ].
+        s nextPutLine:('passed: %1' bindWith:passed size).
+        passed do:[:each |
+            s spaces:4; nextPutLine:each printString
+        ].
+    ].
+    self window setClipboardText:text
 ! !
 
 !TestRunner2 methodsFor:'aspects'!
@@ -1876,7 +1916,7 @@
 !TestRunner2::ClassList class methodsFor:'documentation'!
 
 version
-    ^'$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.55 2015-01-31 14:18:28 cg Exp $'
+    ^'$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.56 2015-02-01 19:55:31 cg Exp $'
 ! !
 
 !TestRunner2::ClassList methodsFor:'private'!
@@ -2381,15 +2421,15 @@
 !TestRunner2 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.55 2015-01-31 14:18:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.56 2015-02-01 19:55:31 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.55 2015-01-31 14:18:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunner2.st,v 1.56 2015-02-01 19:55:31 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: Tools__TestRunner2.st,v 1.55 2015-01-31 14:18:28 cg Exp $'
+    ^ '$Id: Tools__TestRunner2.st,v 1.56 2015-02-01 19:55:31 cg Exp $'
 ! !