From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b74b00d13dd5feab X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!fi.sn.net!newsfeed2.fi.sn.net!feeder2.news.jippii.net!reader1.news.jippii.net!53ab2750!not-for-mail Message-ID: <41683E3F.1090209@nowhere.fi> From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: testing with Ravenscar task References: <41671438$0$1122$626a14ce@news.free.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 09 Oct 2004 22:38:39 +0300 NNTP-Posting-Host: 194.29.197.24 X-Complaints-To: newsmaster@saunalahti.com X-Trace: reader1.news.jippii.net 1097350724 194.29.197.24 (Sat, 09 Oct 2004 22:38:44 EEST) NNTP-Posting-Date: Sat, 09 Oct 2004 22:38:44 EEST Xref: g2news1.google.com comp.lang.ada:4963 Date: 2004-10-09T22:38:39+03:00 List-Id: 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 . @ .