Re: Passing parameters to NUnit
Sujin Han <[email protected]> Tue, 29 Jul 2008 09:12:43 -0700 (PDT)
| Newsgroups | gmane.comp.windows.dotnet.nunit.devel |
|---|---|
| Message-ID | <[email protected]> |
I like the convention that NCover uses - a double slash to specify NCover command line parameters, and a single slash to specify any command line parameters that you like to pass to a module it's loading.
Alternatively, we can have NUnit to ignore any double slash command line parameters. This way, it's fully backward compatible, and people don't have to change the current usage.
For example, to start a test:
nunit-console NUnitDemo.dll /run=STR /err=STR //myparameter:abc
And then, from the test code I can do this:
[TestFixtureSetUp]
public void setup(){
string[] args = Environment.GetCommandLineArgs();
foreach (string arg in args)
{
// process my command line arguments
if (arg.Contains("//"))
// do something
}
}
Thanks
--- On Thu, 7/24/08, Charlie Poole <[email protected]> wrote:
> From: Charlie Poole <[email protected]>
> Subject: RE: [nunit-developer] Passing parameters to NUnit
> To: [email protected], [email protected]
> Date: Thursday, July 24, 2008, 10:14 AM
> At the moment, there is no way to pass such parameters to
> NUnit, nor any way for the test to retrieve them if they
> were passed.
>
> I'm thinking about something like this for a coming
> release, so any suggestions as to how it ought to
> work are welcome.
>
> Charlie
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]]
> On
> > Behalf Of Sujin Han
> > Sent: Thursday, July 24, 2008 7:33 AM
> > To: [email protected]
> > Subject: [nunit-developer] Passing parameters to NUnit
> >
> > Hi
> >
> > I'm looking for a way to pass parameters into an
> NUnit test
> > at start-up time. I thought about faking it by setting
> the
> > environmental variables to get parameters into a test
> case.
> > But before exploring that route I wanted to see if
> there were
> > any other options that's already there. And
> I'm willing to
> > try beta version of Nunit if necessary.
> >
> > Thanks
> >
> >
> >
> >
> >
> >
> --------------------------------------------------------------
> > -----------
> > This SF.Net email is sponsored by the Moblin Your Move
>
> > Developer's challenge Build the coolest Linux
> based
> > applications with Moblin SDK & win great prizes
> Grand prize
> > is a trip for two to an Open Source event anywhere in
> the
> > world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > nunit-developer mailing list
> > [email protected]
> >
> https://lists.sourceforge.net/lists/listinfo/nunit-developer
> >
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/