<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>yes, I had this in mind! :-)</p>
<p><br>
</p>
<p>But smalltalkCI won't do anything that opens a debugger, would it? At least I would not expect this.</p>
<p><br>
</p>
<p>And the rest of my changes should not destroy any existing behavior (with the exception of deprecations, which can be fixed later, too). Or do you see any reason where a semaphore does add value?</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Montag, 30. März 2020 12:11:55<br>
<b>An:</b> John Pfersich via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: SUnit-ct.125.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi all!
<div><br>
</div>
<div>Beware of making substantial changes to the public interface of TestCase or the communication between TestCase and TestResult *because* it might interfere with smalltalkCI and its efforts to remain cross-Smalltalk compatible.</div>
<div><br>
</div>
<div>So, please double-check. :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 29.03.2020 14:03:04 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">Christoph Thiede uploaded a new version of SUnit to project The Inbox:<br>
http://source.squeak.org/inbox/SUnit-ct.125.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: SUnit-ct.125<br>
Author: ct<br>
Time: 29 March 2020, 1:02:50.60056 pm<br>
UUID: 814e778e-04dc-954c-93e3-fb19e307d4c8<br>
Ancestors: SUnit-mt.121<br>
<br>
Proposal: Update debugging logic of TestCase. Instead of abusing #halt, open a debugger directly on the test selector. Deprecates #openDebuggerOnFailingTestMethod.<br>
<br>
Also slightly refactors internal behavior to avoid some duplication, and to get rid of unnecessary semaphores which should not add any value compared to #ensure: unless some really low-level things are broken. Please correct me if I am wrong here!<br>
<br>
=============== Diff against SUnit-mt.121 ===============<br>
<br>
Item was added:<br>
+ ----- Method: TestCase>>assureResourcesDuring: (in category 'private') -----<br>
+ assureResourcesDuring: aBlock<br>
+ <br>
+ | resources |<br>
+ resources := self resources.<br>
+ resources do: [:resource |<br>
+ resource isAvailable ifFalse: [<br>
+ ^ resource signalInitializationError]].<br>
+ ^ aBlock ensure: [<br>
+ resources do: [:resource |<br>
+ resource reset]].!<br>
<br>
Item was changed:<br>
----- Method: TestCase>>debug (in category 'running') -----<br>
debug<br>
+ "Run the receiver and open a debugger on the first failure or error."<br>
+ <br>
+ ^ self assureResourcesDuring: [self runCaseWithoutTimeout]!<br>
- self resources do:<br>
- [ : res | res isAvailable ifFalse: [ ^ res signalInitializationError ] ].<br>
- [ self runCase ] ensure:<br>
- [ self resources do:<br>
- [ : each | each reset ] ]!<br>
<br>
Item was changed:<br>
----- Method: TestCase>>debugAsFailure (in category 'running') -----<br>
debugAsFailure<br>
+ "Spawn a debugger that is ready to debug the receiver."<br>
+ <br>
+ (Process<br>
+ forBlock: [self debug]<br>
+ runUntil: [:context | context selector = testSelector])<br>
+ debug.!<br>
- | semaphore |<br>
- semaphore := Semaphore new.<br>
- self resources do: [:res | <br>
- res isAvailable ifFalse: [^res signalInitializationError]].<br>
- [semaphore wait. self resources do: [:each | each reset]] fork.<br>
- (self class selector: testSelector) runCaseAsFailure: semaphore.!<br>
<br>
Item was changed:<br>
----- Method: TestCase>>openDebuggerOnFailingTestMethod (in category 'running') -----<br>
openDebuggerOnFailingTestMethod<br>
+ <br>
+ self deprecated: 'ct: Use #debugAsFailure'.<br>
+ <br>
"SUnit has halted one step in front of the failing test method. Step over the 'self halt' and
<br>
send into 'self perform: testSelector' to see the failure from the beginning"<br>
- <br>
self<br>
halt;<br>
performTest!<br>
<br>
Item was changed:<br>
----- Method: TestCase>>runCaseAsFailure: (in category 'running') -----<br>
runCaseAsFailure: aSemaphore<br>
+ <br>
+ self deprecated: 'ct: Use #runCaseWithoutTimeout and #ensure:'.<br>
+ ^ [self runCaseWithoutTimeout]<br>
+ ensure: [aSemaphore signal]!<br>
- [self setUp.<br>
- self openDebuggerOnFailingTestMethod] ensure: [<br>
- self tearDown.<br>
- aSemaphore signal]!<br>
<br>
Item was added:<br>
+ ----- Method: TestCase>>runCaseWithoutTimeout (in category 'running') -----<br>
+ runCaseWithoutTimeout<br>
+ <br>
+ [self setUp.<br>
+ self performTest]<br>
+ ensure: [self tearDown].!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</body>
</html>