> It'd be great if we had some attributes like "IgnoreDotNet" and
"IgnoreMono"
> with which we could decorate a test to avoid running tests on specific
> CLR's.  My quick hack to the code would be to change
> TestCaseBuilder.HasIgnoreAttribute() check for the full Ignore, or see
what
> runtime we are on and check for the specific attributes accordingly.

How about using a textual name of the plaftorm for this purpose? The naming
schema could be adopted from NAnt, e.g:

net-1.0
net-1.1
net-1.2
netcf-1.0
sscli-1.0
mono-1.0

This way we could even employ some wildcards. Like "mono-1.*" to represent
any mono v1.x.

Same thing should apply to OSes ("platforms" in NAnt terminology). One
should be able to run the test on a particular OS or platform. For example
if your test uses filesystemwatcher it shouldn't be ran on Win95.

Some ideas below:

[Test]
[IgnoreOnFramework("net-1.0")]
void A()
{
}

[Test]
[IgnoreOnFramework("net-1.1")] // this would not run on .NET 1.1
void B()
{
}

[Test]
[IgnoreOnFramework("net-1.*")]    // this would not run on ALL .NET
platforms
void C()
{
}

[Test]
[IgnoreOnPlatform(Platform.Win32)]    // this would not run on Win32
platforms
void D()
{
}

[Test]
[IgnoreOnPlatform(Platform.Unix)]    // this would not run on Unix platforms
void E()
{
}

[Test]
[RunOnPlatform(Platform.Win32)]    // this would run only on Win32 platforms
void F()
{
}

[Test]
[RunOnFramework("mono-1.*")]    // this would run only on Mono
void G()
{
}

There are more (open source) tools that target multiple platforms/oses. I
think it would be great to have some agreement on this attribute usage. For
example in NAnt we're discussing the possibility of implementing os-specific
or platform-specific tasks,types or functions in a single codebase. We've
tentatively decided that using such attributes is a way to go.

BTW. I think that the "excluded because of the framework/os" status
shouldn't be the same thing as "ignored" in NUnit. Tests are "ignored"
because they are known to temporarily fail, while RunOn... and IgnoreOn...
means something different here.

Jarek



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to