Please see SUnit-ct.133 for a slightly revised proposal. :-)<br>
<br>
<font color="#808080">---<br>
</font><font color="#808080"><i>Sent from </i></font><font color="#808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></font><br>
<br>
On 2020-03-30T16:38:03+02:00, marcel.taeumel@hpi.de wrote:<br>
<br>
> Hi Christoph,<br>
> <br>
> I think that this contribution is compatible with smalltalkCI. Yes. :-)<br>
> <br>
> Best,<br>
> Marcel<br>
> Am 30.03.2020 15:14:14 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:<br>
> Hi Marcel,<br>
> <br>
> yes, I had this in mind! :-)<br>
> <br>
> But smalltalkCI won't do anything that opens a debugger, would it? At least I would not expect this.<br>
> <br>
> 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?<br>
> <br>
> Best,<br>
> Christoph<br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
> Gesendet: Montag, 30. März 2020 12:11:55<br>
> An: John Pfersich via Squeak-dev<br>
> Betreff: Re: [squeak-dev] The Inbox: SUnit-ct.125.mcz<br>
>  <br>
> Hi all!<br>
> <br>
> 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.<br>
> <br>
> So, please double-check. :-)<br>
> <br>
> Best,<br>
> Marcel<br>
> Am 29.03.2020 14:03:04 schrieb commits at source.squeak.org <commits at source.squeak.org>:<br>
> 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>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200330/f25caced/attachment.html><br>
> <br>