comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » unit testing for IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Unit Testing [message #52055 is a reply to message #43473] Wed, 03 January 2007 18:06 Go to previous messageGo to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
Could you supply a reference for Unit Testing for those of us who are not
familiar with it?
Thanks,
Dick French



On 1/2/07 9:14 PM, in article
1167790448.349519.240060@h40g2000cwb.googlegroups.com, "Robbie"
<retsil@iinet.net.au> wrote:

> Hi,
>
> Are there any implementations of Unit Testing in IDL yet? I've put
> together a white paper for unit testing in IDL. It is fairly straight
> forward, and I've tried to make it easy to run tests of currently
> compiled code. However, there is no point implementing it if someone
> has a better idea of how to go about unit testing.
>
> http://www.barnett.id.au/idl/UnitRun.html
>
>
> Robbie
>
> ------------------------------------------------------------ ------------------
> --------------------------------------------------
>
> UnitRun is an adaptation of testing frameworks such as NUnit, JUnit and
> PyUnit. The final aim of this project is to fully support xUnit testing
> automation, including support for fixtures.
> Unit test procedures
> Unit tests are called using specially named test procedures.
> Expected procedure names:
>
> * hashtable__test
> * hashtable__test0
> * hashtable__test1
> * hashtable__test0000445
>
> A simple test case
>
> unitSearch
>
> pro hashtable__test1
> obj = obj_new('hashtable')
> obj -> Add, 'one', 1
> unitAssert, obj -> isContained('one')
> obj_destroy, obj
> end
>
> The unitSearch directive indicates that all subsequent test procedures
> should be included as unit tests. The unitAssert procedure reports the
> result of the test.
>
> 1. The unitAssert procedure reports the name of the test procedure
> (see HELP, CALLS=calls)
> 2. The unitAssert procedure reports <success> if the argument is
> greater than one
> 3. The unitAssert procedure reports <fail> in any other circumstance
> including unhandled execptions
>
> Running tests
>
> reslove_routine, 'hashtable__test1'
> unitRun
>
> The unitRun procedure looks for all specially named test procedures.
> All test procedures are re-resolved. Only procedures with the
> unitSearch directive will be included in unit test.
>
> unitRun, ['hashtable__test1','hashtable__test2']
>
> The unitRun procedure can be used to manually call a sequence of test
> procedures. In this case procedures are called directly without paying
> attention to unitSearch.
>
> unitRun, LOG_FILE='unitRun.log'
>
> The unitRun procedure can dump the test results to a log file instead
> of dumping the results to the IDL command line.
> Expected exceptions
>
> pro hashtable__test2
> obj = obj_new('hashtable')
> obj -> Add, 'one', 1
> unitException, 'obj -> Add, 5, 6'
> obj_destroy, obj
> end
>
> The unitException procedure executes a single IDL statement which is
> expected to result in an exception. The unitException does not
> currently distinguish between message blocks or names.
>
> 1. The unitException procedure reports <success> if an exeception
> was encountered
> 2. The unitException procedure reports <fail> if no exception was
> encountered
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 'vectorizing functions'
Next Topic: How to save TIF in BIL or BIP ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 07:06:11 PDT 2025

Total time taken to generate the page: 1.59855 seconds