The Inbox: SUnit-ct.128.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: SUnit-ct.128.mcz

commits-2
Christoph Thiede uploaded a new version of SUnit to project The Inbox:
http://source.squeak.org/inbox/SUnit-ct.128.mcz

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

Name: SUnit-ct.128
Author: ct
Time: 9 April 2020, 2:49:35.789949 pm
UUID: ade92890-dd0e-ec43-95d0-17bfc9d65507
Ancestors: SUnit-mt.121

Refactor timeout tests in SUnitTest.

- Speed up SUnitTest suite by reducing particular timeouts. I don't think it is necessary to make every run of the SUnit test suite block everything for >10 seconds.
- Use modern chronology protocol
- Refine assertions in #testTestTimeout and test #defaultTimeout

=============== Diff against SUnit-mt.121 ===============

Item was added:
+ ----- Method: SUnitTest>>defaultTimeout (in category 'accessing') -----
+ defaultTimeout
+
+ self selector = #testTestTimeout ifTrue: [
+ ^ 0.3 "seconds"].
+ ^ super defaultTimeout!

Item was changed:
  ----- Method: SUnitTest>>setUp (in category 'running') -----
  setUp
+
+ hasSetup := true.!
- hasSetup := true
- !

Item was changed:
  ----- Method: SUnitTest>>testRunning (in category 'tests') -----
  testRunning
 
+ 0.2 seconds wait.
- (Delay forSeconds: 2) wait
  !

Item was changed:
  ----- Method: SUnitTest>>testTestTimeout (in category 'tests') -----
  testTestTimeout
+
+ self
+ shouldnt: [(self timeoutForTest / 2) seconds wait]
+ raise: TestFailure.
+ self
+ should: [(self timeoutForTest / 2 + 0.1) seconds wait]
+ raise: TestFailure.!
- self should:[(Delay forSeconds: (self timeoutForTest + 1)) wait] raise: TestFailure.
- !

Item was changed:
  ----- Method: SUnitTest>>testTestTimeoutLoop (in category 'tests') -----
  testTestTimeoutLoop
+ <timeout: 0.1 "seconds">
+ self
+ should: [[] repeat]
+ raise: TestFailure.
- <timeout: 1>
- self should:[[] repeat] raise: TestFailure.
  !

Item was added:
+ ----- Method: SUnitTest>>testTestTimeoutPragma (in category 'tests') -----
+ testTestTimeoutPragma
+ <timeout: 0.1 "seconds">
+ self
+ should: [0.2 seconds wait]
+ raise: TestFailure.
+ !

Item was removed:
- ----- Method: SUnitTest>>testTestTimeoutTag (in category 'tests') -----
- testTestTimeoutTag
- <timeout: 1>
- self should:[(Delay forSeconds: 3) wait] raise: TestFailure.
- !

Item was changed:
  ----- Method: TestCase>>should:raise: (in category 'accessing') -----
+ should: aBlock raise: anExceptionalEvent
+
+ ^ self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent)!
- should: aBlock raise: anExceptionalEvent
- ^self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent)
- !