This project has moved and is read-only. For the latest updates, please go here.

Choosing a LA provider when running unit tests

Mar 12, 2011 at 1:06 PM

Hi All,

I'm trying to come up with an easy way of selecting which linear algebra provider to use when running the unit tests (the full suite) and I'm drawing a blank. The least efficient way is to create a seperate unit test project for each provider. But this will become tedious as the tests change. I thought maybe we could use the NUnit SetupFixture attribute  (on a class not in a namespace so it applies to all tests). The problem is how to tell the setup method which provider to select. There doesn't seem to be a pass a parameter to NUnit at runtime (we could put something in file and read it in but that just seems wrong). 

Any ideas?


Mar 13, 2011 at 12:41 PM

I added a Setup class (using NUnit's SetupFixture), an app.config file and a LinearAlgebraProvider application setting to the unit test project. The setup class will look at the LinearAlgebraProvider setting and sets the corresponding provider. Not particularly elegant, but seems to work.