<div dir="ltr">Woops, I misread the + Timestamp line, and in context of these new timings, thought you had added it. Sorry Marcel. :)<div><br></div><div>Even without knowing, you were still kind to offer to begin that clean up. No expectations, but if you have time next time, thank you. :)</div><div><br></div><div>Best,</div><div> Chris</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 6, 2019 at 12:53 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_8614254456215433460__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
Hi Chris,<div><br></div><div>sure. I didn't touch that part yet, but I can clean that up in SUnit. :-) For the measurements, I use plain milliseconds and Duration.</div><div><br></div><div>Best,</div><div>Marcel</div><div class="gmail-m_8614254456215433460mb_sig"></div><blockquote class="gmail-m_8614254456215433460history_container" type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
<p style="color:rgb(170,170,170);margin-top:10px">Am 05.09.2019 22:17:40 schrieb Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr">Hey Marcel, I think we're trying to get to a place where we can deprecate TimeStamp. Would you mind using DateAndTime instead?<div><br></div><div>Best,</div><div> Chris</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2019 at 10:27 AM <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Marcel Taeumel uploaded a new version of SUnit to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/SUnit-mt.117.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/SUnit-mt.117.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: SUnit-mt.117<br>
Author: mt<br>
Time: 4 September 2019, 5:27:53.689072 pm<br>
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4<br>
Ancestors: SUnit-mt.116<br>
<br>
Measure the time to run a test and store it into the test-case history.<br>
<br>
=============== Diff against SUnit-mt.116 ===============<br>
<br>
Item was changed:<br>
----- Method: TestCase>>run: (in category 'running') -----<br>
run: aResult <br>
+ aResult runCaseMeasured: self.<br>
- aResult runCase: self.<br>
!<br>
<br>
Item was changed:<br>
Object subclass: #TestResult<br>
+ instanceVariableNames: 'timeStamp failures errors passed durations'<br>
- instanceVariableNames: 'timeStamp failures errors passed'<br>
classVariableNames: ''<br>
poolDictionaries: ''<br>
category: 'SUnit-Kernel'!<br>
<br>
!TestResult commentStamp: '<historical>' prior: 0!<br>
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.!<br>
<br>
Item was added:<br>
+ ----- Method: TestResult>>duration (in category 'accessing') -----<br>
+ duration<br>
+ <br>
+ ^ self durations inject: 0 into: [:sum :each | sum + each]!<br>
<br>
Item was added:<br>
+ ----- Method: TestResult>>durations (in category 'accessing') -----<br>
+ durations<br>
+ ^ durations!<br>
<br>
Item was changed:<br>
----- Method: TestResult>>initialize (in category 'initialization') -----<br>
initialize<br>
super initialize.<br>
passed := OrderedCollection new.<br>
failures := Set new.<br>
errors := OrderedCollection new.<br>
+ timeStamp := TimeStamp now.<br>
+ durations := Dictionary new.!<br>
- timeStamp := TimeStamp now!<br>
<br>
Item was changed:<br>
----- Method: TestResult>>printOn: (in category 'printing') -----<br>
printOn: aStream<br>
aStream<br>
nextPutAll: self runCount printString;<br>
+ nextPutAll: ' run in ';<br>
+ nextPutAll: (Duration milliSeconds: self duration) printString;<br>
+ nextPutAll: ', ';<br>
- nextPutAll: ' run, ';<br>
nextPutAll: self expectedPassCount printString;<br>
nextPutAll: ' passes, ';<br>
nextPutAll: self expectedDefectCount printString;<br>
nextPutAll:' expected failures, ';<br>
nextPutAll: self unexpectedFailureCount printString;<br>
nextPutAll: ' failures, ';<br>
nextPutAll: self unexpectedErrorCount printString;<br>
nextPutAll:' errors, ';<br>
nextPutAll: self unexpectedPassCount printString;<br>
nextPutAll:' unexpected passes'.!<br>
<br>
Item was added:<br>
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----<br>
+ runCaseMeasured: aTestCase<br>
+ <br>
+ self durations<br>
+ at: aTestCase<br>
+ put: [self runCase: aTestCase] timeToRunWithoutGC.!<br>
<br>
Item was changed:<br>
----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----<br>
selectResultsForTestCase: aTestCaseClass<br>
+ | passedSelectors errorsSelectors failuresSelectors testCaseDurations |<br>
+ <br>
- | passedSelectors errorsSelectors failuresSelectors |<br>
passedSelectors := self passed<br>
select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].<br>
errorsSelectors := self errors <br>
select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].<br>
failuresSelectors := self failures <br>
select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].<br>
+ <br>
+ testCaseDurations := Dictionary new.<br>
+ self durations keysAndValuesDo: [:testCase :milliseconds |<br>
+ testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]]. <br>
+ <br>
+ ^ self class newTestDictionary<br>
+ at: #timeStamp put: self timeStamp; "Keep this result's time stamp."<br>
- <br>
- ^ self class newTestDictionary <br>
at: #passed put: passedSelectors asSet;<br>
at: #failures put: failuresSelectors asSet;<br>
at: #errors put: errorsSelectors asSet;<br>
+ at: #durations put: testCaseDurations;<br>
+ at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);<br>
yourself<br>
!<br>
<br>
<br>
</blockquote></div>
</div></blockquote>
</div></div><br>
</blockquote></div>