[IronPython] NUnit with IronPython

Martin Maly Martin.Maly at microsoft.com
Thu Dec 8 19:56:18 CET 2005


Name mangling for classes is not complicated. What makes it harder is not the naming, it is the way the classes are compiled. Class gets generated as a static function named: <class name>$maker<integer> that creates the class (the type) at runtime.

Other than source code and exploration of generated binaries using ildasm or reflector, we don't currently have documentation on this, unfortunately.

Martin


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade
Sent: Thursday, December 08, 2005 10:38 AM
To: Discussion of IronPython
Subject: Re: [IronPython] NUnit with IronPython

Sadly, NUnit won't run static methods, so that won't work, but thank you anyway.

Are class names similarly mangled? If there's any documentation on this, I'd really appreciate a pointer to it, as I haven't been able to find much help elsewhere... or is it just a matter of hunting through the source?

William

Martin Maly wrote:

>IronPython mangles names. For example:
>
>def method():
>    return 1
>
>Produces:
>
>public static object method$f0()
>
>The test_prefix would get therefore preserved so on a second thought, this may work, provided that nunit executes public static methods and doesn't require specific return value. Ours is always "object" in this case.
>
>Martin
>
>
>-----Original Message-----
>From: users-bounces at lists.ironpython.com 
>[mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade
>Sent: Thursday, December 08, 2005 10:02 AM
>To: Discussion of IronPython
>Subject: Re: [IronPython] NUnit with IronPython
>
>Does this mean that IronPython will emit methods, but their names will be mangled, or that it simply won't produce anything that can be effectively used from outside?
>
>William
>
>Martin Maly wrote:
>
>  
>
>>This is, sadly, true. IronPython will not preserve the name of the method as we know it...
>>
>>Martin
>>
>>-----Original Message-----
>>From: users-bounces at lists.ironpython.com
>>[mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. 
>>Farmer
>>Sent: Thursday, December 08, 2005 9:46 AM
>>To: Discussion of IronPython
>>Subject: Re: [IronPython] NUnit with IronPython
>>
>>For backwards compatibility, NUnit would also accept method names beginning with "test" ("test_" ?).  However, I don't think IP emits methods as we know them yet?
>>
>>-----
>>Keith J. Farmer // kfarmer at thuban.org
>> 
>>
>>    
>>
>
>_______________________________________________
>users mailing list
>users at lists.ironpython.com
>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>_______________________________________________
>users mailing list
>users at lists.ironpython.com
>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>  
>

_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list