[fpc-devel] .NET Reflection vs RTTI

Michael Van Canneyt michael at freepascal.org
Wed Nov 21 15:13:12 CET 2007



On Wed, 21 Nov 2007, Vincent Snijders wrote:

> Micha Nelissen schreef:
> > Thorsten Engler wrote:
> > > Take a look here to get some idea about the uses for attributes in just
> > > the
> > > core framework: http://msdn2.microsoft.com/en-us/library/2e39z096.aspx
> > 
> > What? Most sounds like poor hacks to get around compiler/linker limitations.
> > 
> <snip>
> 
> > Perhaps there are also useful ones, that do reduce application and framework
> > programmers code significantly?
> 
> In c# code I use attributes for the unit test frame work. Unittest are
> compiled into a dll. The unit test runner loads the Dll and considers all
> classes with the [TestFixture] attribute to be classes that contain test
> methods. All test methods have the [Test] attribute. Test methods can also be
> given an [Ignore] attribrute to disable testing it. Or an
> [Category("LongTest")] attribute with "LongTest" a free string parameter to
> create categories in your test suite, so that you tell the test runner to run
> only a selection of the tests or to skip running them.
> 
> The current fpc solution is that you need to register classes with test
> methods. This is an extra action.

You must type the 'TestFixture' attribute also, so no extras here.
Really...

Michael.



More information about the fpc-devel mailing list