The Trunk: SUnit-ar.80.mcz

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

The Trunk: SUnit-ar.80.mcz

commits-2
Andreas Raab uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-ar.80.mcz

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

Name: SUnit-ar.80
Author: ar
Time: 10 July 2010, 1:12:48.265 pm
UUID: 4062ff78-c0a8-e94f-a336-93d01aebbe96
Ancestors: SUnit-dtl.79

A halt needs to cancel a pending timeout, too.

=============== Diff against SUnit-dtl.79 ===============

Item was changed:
  ----- Method: TestCase>>timeout:after: (in category 'running') -----
  timeout: aBlock after: seconds
  "Evaluate the argument block. Time out if the evaluation is not
  complete after the given number of seconds. Handle the situation
  that a timeout may occur after a failure (during debug)"
 
  | theProcess delay watchdog |
 
  "the block will be executed in the current process"
  theProcess := Processor activeProcess.
  delay := Delay forSeconds: seconds.
 
  "make a watchdog process"
  watchdog := [
  delay wait. "wait for timeout or completion"
  theProcess ifNotNil:[ theProcess signalException:
  (TestFailure new messageText: 'Test timed out') ]
  ] newProcess.
 
  "Watchdog needs to run at high priority to do its job (but not at timing priority)"
  watchdog priority: Processor timingPriority-1.
 
  "catch the timeout signal"
  watchdog resume. "start up the watchdog"
+ ^[aBlock on: TestFailure, Error, Halt do:[:ex|
- ^[aBlock on: TestFailure, Error do:[:ex|
  theProcess := nil.
  ex pass.
  ]] ensure:[ "evaluate the receiver"
  theProcess := nil. "it has completed, so ..."
  delay delaySemaphore signal. "arrange for the watchdog to exit"
  ]!