comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <nobody@nowhere.fi>
Subject: Re: testing with Ravenscar task
Date: Sat, 09 Oct 2004 22:38:39 +0300
Date: 2004-10-09T22:38:39+03:00	[thread overview]
Message-ID: <41683E3F.1090209@nowhere.fi> (raw)
In-Reply-To: 41671438$0$1122$626a14ce@news.free.fr

Lionel Draghi wrote:
> Hi,
> 
> I am curious about native tests on code embedding Ravenscar task.
> Those task are supposed never end. (Behaviour is implementation 
> dependent in this case, as far as I remember).
> 
> So, how can I have my unit tests ending normally, and in a way portable 
> amonst compiler?

Ravenscar task bodies (at least those with just one suspension point) 
can usually be made very simple by putting the real computation in a 
procedure defined outside the task. This procedure can be unit-tested in 
the normal way. The task body is then a few lines for the eternal loop, 
the activation condition (delay-until or entry call) and the procedure 
call, hardly worth unit-testing.

If you put the tasks and computational procedures in different packages 
you can avoid "withing" the task packages in the unit tests and so avoid 
the task termination issue.

A nice side effect of this package structure is that elaboration 
circularities caused by tasks are much reduced.

Niklas Holsti
Tidorum Ltd

niklas holsti tidorum fi
       .      @       .




  parent reply	other threads:[~2004-10-09 19:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 22:27 testing with Ravenscar task Lionel Draghi
2004-10-08 23:00 ` Ed Falis
2004-10-09 22:23   ` Lionel Draghi
2004-10-09 19:38 ` Niklas Holsti [this message]
2004-10-09 22:25   ` Lionel Draghi
2004-10-10 18:25     ` Niklas Holsti
2004-10-10  2:01 ` bh
2004-10-11 22:25   ` Lionel Draghi
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox