Christoph Thiede uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-ct.133.mcz
==================== Summary ====================
Name: SUnit-ct.133
Author: ct
Time: 29 December 2021, 6:38:28.060638 pm
UUID: 83af50fb-86e6-d843-8e9e-9abe8e8e379a
Ancestors: SUnit-mt.125
Updates debugging logic of TestCase. Instead of abusing #halt, open a debugger directly on the entrypoint to run the case. Deprecates #openDebuggerOnFailingTestMethod.
Also slightly refactors internal behavior to avoid some duplication, and to get rid of unnecessary semaphores which do not add any value compared to #ensure: unless some really low-level things are broken.
Supersedes SUnit-ct.125. Based on my own experiences from >1.5 years, I have revised #debugAsFailure to always halt right before sending #setUp. This improves a) the explorability of any custom set-up/tear-down logic of the test case and b) the immediacy of opening a debugger if you have a very heavy #setUp implementation. From the user perspective, effectively, you still have to click "Over-into-over-into" to navigate into the actual test method.
Please report back whether you find this behavior acceptable. :-)
=============== Diff against SUnit-mt.125 ===============
Item was added:
+ ----- Method: TestCase>>assureResourcesDuring: (in category 'private') -----
+ assureResourcesDuring: aBlock
+
+ | resources |
+ resources := self resources.
+ resources do: [:resource |
+ resource isAvailable ifFalse: [
+ ^ resource signalInitializationError]].
+ ^ aBlock ensure: [
+ resources do: [:resource |
+ resource reset]].!
Item was changed:
----- Method: TestCase>>debug (in category 'running') -----
debug
+ "Run the receiver and open a debugger on the first failure or error."
+
+ ^ self assureResourcesDuring: [self runCaseWithoutTimeout]!
- self resources do:
- [ : res | res isAvailable ifFalse: [ ^ res signalInitializationError ] ].
- [ self runCase ] ensure:
- [ self resources do:
- [ : each | each reset ] ]!
Item was changed:
----- Method: TestCase>>debugAsFailure (in category 'running') -----
debugAsFailure
+ "Spawn a debugger that is ready to debug the receiver."
+
+ (Process
+ forBlock: [self debug]
+ runUntil: [:context | context isClosureContext "navigate the process directly to the point where it is about to send #setUp"
+ and: [context selector = #runCaseWithoutTimeout]])
+ debug.!
- | semaphore |
- semaphore := Semaphore new.
- self resources do: [:res |
- res isAvailable ifFalse: [^res signalInitializationError]].
- [semaphore wait. self resources do: [:each | each reset]] fork.
- (self class selector: testSelector) runCaseAsFailure: semaphore.!
Item was changed:
----- Method: TestCase>>openDebuggerOnFailingTestMethod (in category 'running') -----
openDebuggerOnFailingTestMethod
+
+ self deprecated: 'ct: Use #debugAsFailure'.
+
"SUnit has halted one step in front of the failing test method. Step over the 'self halt' and
send into 'self perform: testSelector' to see the failure from the beginning"
-
self
halt;
performTest!
Item was changed:
----- Method: TestCase>>runCaseAsFailure: (in category 'running') -----
runCaseAsFailure: aSemaphore
+
+ self deprecated: 'ct: Use #runCaseWithoutTimeout and #ensure:'.
+ ^ [self runCaseWithoutTimeout]
+ ensure: [aSemaphore signal]!
- [self setUp.
- self openDebuggerOnFailingTestMethod] ensure: [
- self tearDown.
- aSemaphore signal]!
Item was added:
+ ----- Method: TestCase>>runCaseWithoutTimeout (in category 'running') -----
+ runCaseWithoutTimeout
+
+ [self setUp.
+ self performTest]
+ ensure: [self tearDown].!
Christoph Thiede uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-ct.122.mcz
==================== Summary ====================
Name: SUnit-ct.122
Author: ct
Time: 14 December 2019, 1:15:22.187841 am
UUID: fc845d69-2525-9440-b4c0-4da1e1f4f1cd
Ancestors: SUnit-mt.120
Add check for a TestCase whether it is still installed (that is, the test selector has not been removed)
=============== Diff against SUnit-mt.120 ===============
Item was added:
+ ----- Method: TestCase>>isInstalled (in category 'testing') -----
+ isInstalled
+
+ ^ self respondsTo: testSelector!
Christoph Thiede uploaded a new version of SUnitGUI to project The Trunk:
http://source.squeak.org/trunk/SUnitGUI-ct.80.mcz
==================== Summary ====================
Name: SUnitGUI-ct.80
Author: ct
Time: 20 March 2020, 7:09:46.074237 pm
UUID: 971ba1c3-02e8-d14c-bc4a-7cc09fa52244
Ancestors: SUnitGUI-mt.79
Reverts SUnitGUI-cmm.78 which was considered unpleasant by the majority of reviewers (read here: http://forum.world.st/The-Trunk-SUnitGUI-cmm-78-mcz-td5108915.html).
=============== Diff against SUnitGUI-mt.79 ===============
Item was changed:
----- Method: TestRunner>>representsSameBrowseeAs: (in category 'accessing-ui') -----
representsSameBrowseeAs: anotherModel
+ ^ self class = anotherModel class
+ and: [ classesSelected = anotherModel classesSelected ]!
- ^ true!