[squeak-dev] The Trunk: SUnit-ct.128.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 10 18:02:11 UTC 2022


Christoph Thiede uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/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)
- 			!



More information about the Squeak-dev mailing list