[Mono-devel-list] Detecting Mono

Nick D ndrochak at gol.com
Tue Feb 17 03:59:34 EST 2004

>| -----Original Message-----
>| From: Ben Maurer [mailto:bmaurer at users.sourceforge.net]
>| Sent: Tuesday, February 17, 2004 3:23 AM
>| To: Charlie Poole
>| Cc: 'Jaroslaw Kowalski'; 'Nick Drochak'; Mono Development; '! nant'
>| Subject: RE: [Mono-devel-list] Detecting Mono
>| I really, really dont think this is the way to go.
>| Software should not work like this:
>| "if you are running on windows, pressing `foo' will result in blah. As
>| an exception, on windows 98, nothing will happen. On linux, it will do
>| bar if it is running on RedHat 9 or Fedora, but will do baz if it is
>| running on any other linux system."
>| You might have a feature that is implemented in different ways on
>| different systems -- for example, maybe on Windows you store a key in
>| the registry, but on Linux you store it in a dot file.

This depends on what exactly you are testing and what other concerns you are
addressing.  At a certain level of granularity it does matter.  A unit test
to make sure the dot file got the value is different from the unit test to
make sure the registry got updated. Unit tests can and should test different
levels of abstraction.

>| Having different tests for different platforms implies that you intend
>| for the program to work differently in each platform. This isnt really
>| consistant with having a program that is really cross platform.

We already have this with .NET 1.1 vs. .NET 1.0. As bugs get fixed, for
example, we have different results in different versions of .NET.  I think
the Platform attribute is a nice, consistent extension that handles this
nicely. I can think of a few other issues this allows us to handle:
 - Places we choose not to have bug-for-bug compatibility with .NET
 - File related mis-matches due to differences in the OS's, e.g.
 - Stuff I don't even know about yet that will come from the PPC version of
mono running on a Mac

I agree this is a tool that needs to be used correctly and carefully--more
like a surgeon with a scalpel than a lumberjack with a magic chainsaw :)

We just need to keep our eyes open and watch the patches coming in on tests.

Nick D.

More information about the Mono-devel-list mailing list