[squeak-dev] The Trunk: SUnit-mt.117.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Sep 9 07:26:08 UTC 2019


Well, smalltalkCI did a full source copy of Squeak's TestRunner. It should then also copy TestResult and TestCase, I suppose. :-)

Best,
Marcel
Am 07.09.2019 16:01:48 schrieb Jakob Reschke <forums.jakob at resfarm.de>:
I think this broke smalltalkCI.

Running suite "Squeak64-trunk on Travis CI (32.1)" with 316 tests.
509vvvvvvvvvvvvvvvvvv MessageNotUnderstood: SCISqueakTestRunner>>runCaseMeasured: vvvvvvvvvvvvvvvvvv
510The time is 2019-09-07T11:42:29.61308+00:00
511SCISqueakTestRunner(Object)>>doesNotUnderstand: #runCaseMeasured:
512FSBreadthFirstGuideTest(TestCase)>>run:
513[] in SCISqueakTestRunner(SCITestRunner)>>runAll


<commits at source.squeak.org [mailto:commits at source.squeak.org]> schrieb am Mi., 4. Sep. 2019, 17:28:

Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz [http://source.squeak.org/trunk/SUnit-mt.117.mcz]

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190909/85ba7b20/attachment.html>


More information about the Squeak-dev mailing list