Discussion:
.config /noshadow usage
Smith, Gabe
2008-07-23 22:52:46 UTC
Permalink
Hi,



I need to use the /NoShadow option, but, I need to use it in a config
file. Does anyone know if this can be done? If so, how?



I am using NUnit 2.2.9.



Many Thanks Everyone,

Gabe
Charlie Poole
2008-07-24 00:13:56 UTC
Permalink
No, NUnit will enable shadow copying unless you specify /noshadow on the
command line.

Can you explain why you need to use this option. I ask because, often,
people think they need this for reasons that have other, less drastic
solutions.

Charlie


_____

From: nunit-developer-***@lists.sourceforge.net
[mailto:nunit-developer-***@lists.sourceforge.net] On Behalf Of Smith,
Gabe
Sent: Wednesday, July 23, 2008 3:53 PM
To: nunit-***@lists.sourceforge.net
Subject: [nunit-developer] .config /noshadow usage



Hi,



I need to use the /NoShadow option, but, I need to use it in a config file.
Does anyone know if this can be done? If so, how?



I am using NUnit 2.2.9.



Many Thanks Everyone,

Gabe
Sujin Han
2008-07-24 14:32:30 UTC
Permalink
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=/
Charlie Poole
2008-07-24 17:14:13 UTC
Permalink
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-----
Behalf Of Sujin Han
Sent: Thursday, July 24, 2008 7:33 AM
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
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=/
Sujin Han
2008-07-29 16:12:43 UTC
Permalink
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
Subject: RE: [nunit-developer] Passing parameters to NUnit
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-----
On
Behalf Of Sujin Han
Sent: Thursday, July 24, 2008 7:33 AM
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
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=/
Charlie Poole
2008-07-29 17:09:57 UTC
Permalink
So there are really two things to decide...
1) How to pass the parameters into NUnit
2) How the tests can access them

1) The double slash convention is nice, although not directly
translatable into the Linux environment. I wonder if there
is a similar convention that they use. Maybe we could have
a longer, cross-platform approach like /test-args= as the
last option on the command line but still support the //
shortcut on Windows.

2) Using Environment.CommandLineArguments is a bit problematic,
since we don't execute your tests as an exe. The commandline
args would be those for nunit, nunit-console, nunit-agent,
visual studio, or whatever environment you were under.
I think we need to provide something separate like
TestContext.TestArguments for this to work.

Charlie
-----Original Message-----
Sent: Tuesday, July 29, 2008 9:13 AM
Subject: RE: [nunit-developer] Passing parameters to NUnit
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.
nunit-console NUnitDemo.dll /run=STR /err=STR //myparameter:abc
[TestFixtureSetUp]
public void setup(){
string[] args = Environment.GetCommandLineArgs();
foreach (string arg in args)
{
// process my command line arguments
if (arg.Contains("//"))
// do something
}
}
Thanks
Subject: RE: [nunit-developer] Passing parameters to NUnit
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-----
On
Behalf Of Sujin Han
Sent: Thursday, July 24, 2008 7:33 AM
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
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=/
Jeff Brown
2008-07-29 21:53:09 UTC
Permalink
A better convention is the one to precede the list of arguments to be passed
along straight with --.

eg. MyWrapperApp.exe -somearg -someother arg MyProgram.exe --
-argformyprogram foo bar

What's nice is that it nests trivially.

The Windows CMD does something similar with the /C and /K arguments. All
following text is interpreted as the command.

Jeff.

-----Original Message-----
From: nunit-developer-***@lists.sourceforge.net
[mailto:nunit-developer-***@lists.sourceforge.net] On Behalf Of Charlie
Poole
Sent: Tuesday, July 29, 2008 10:10 AM
To: nunit-***@lists.sourceforge.net
Subject: Re: [nunit-developer] Passing parameters to NUnit

So there are really two things to decide...
1) How to pass the parameters into NUnit
2) How the tests can access them

1) The double slash convention is nice, although not directly translatable
into the Linux environment. I wonder if there is a similar convention that
they use. Maybe we could have a longer, cross-platform approach like
/test-args= as the last option on the command line but still support the //
shortcut on Windows.

2) Using Environment.CommandLineArguments is a bit problematic, since we
don't execute your tests as an exe. The commandline args would be those for
nunit, nunit-console, nunit-agent, visual studio, or whatever environment
you were under.
I think we need to provide something separate like TestContext.TestArguments
for this to work.

Charlie
-----Original Message-----
Sent: Tuesday, July 29, 2008 9:13 AM
Subject: RE: [nunit-developer] Passing parameters to NUnit
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.
nunit-console NUnitDemo.dll /run=STR /err=STR //myparameter:abc
[TestFixtureSetUp]
public void setup(){
string[] args = Environment.GetCommandLineArgs();
foreach (string arg in args)
{
// process my command line arguments
if (arg.Contains("//"))
// do something
}
}
Thanks
Subject: RE: [nunit-developer] Passing parameters to NUnit
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-----
On
Behalf Of Sujin Han
Sent: Thursday, July 24, 2008 7:33 AM
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
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=/
_______________________________________________
nunit-developer mailing list
nunit-***@lists.sourceforge.net
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=/
Charlie Poole
2008-07-29 23:41:12 UTC
Permalink
Nice idea. I'll experiment with that on both platforms.

Charlie
-----Original Message-----
Behalf Of Jeff Brown
Sent: Tuesday, July 29, 2008 2:53 PM
Subject: Re: [nunit-developer] Passing parameters to NUnit
A better convention is the one to precede the list of
arguments to be passed along straight with --.
eg. MyWrapperApp.exe -somearg -someother arg MyProgram.exe
-- -argformyprogram foo bar
What's nice is that it nests trivially.
The Windows CMD does something similar with the /C and /K
arguments. All following text is interpreted as the command.
Jeff.
-----Original Message-----
Behalf Of Charlie Poole
Sent: Tuesday, July 29, 2008 10:10 AM
Subject: Re: [nunit-developer] Passing parameters to NUnit
So there are really two things to decide...
1) How to pass the parameters into NUnit
2) How the tests can access them
1) The double slash convention is nice, although not directly
translatable into the Linux environment. I wonder if there is
a similar convention that they use. Maybe we could have a
longer, cross-platform approach like /test-args= as the last
option on the command line but still support the // shortcut
on Windows.
2) Using Environment.CommandLineArguments is a bit
problematic, since we don't execute your tests as an exe. The
commandline args would be those for nunit, nunit-console,
nunit-agent, visual studio, or whatever environment you were under.
I think we need to provide something separate like
TestContext.TestArguments for this to work.
Charlie
-----Original Message-----
Sent: Tuesday, July 29, 2008 9:13 AM
Subject: RE: [nunit-developer] Passing parameters to NUnit
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.
nunit-console NUnitDemo.dll /run=STR /err=STR //myparameter:abc
[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
Subject: RE: [nunit-developer] Passing parameters to NUnit
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-----
On
Behalf Of Sujin Han
Sent: Thursday, July 24, 2008 7:33 AM
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
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=/
_______________________________________________
nunit-developer mailing list
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=/
_______________________________________________
nunit-developer mailing list
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=/
Sujin Han
2008-07-29 23:03:32 UTC
Permalink
I have created an extension from ITestCaseBuilder. In BuildFrom method, I instantiate TestSuite and call Add method to dynamically add a bunch of test cases.

In my test module I use a custom attribute to "trigger" the creation of these test cases, which all show correctly when loaded in NUnit.

The problem is that in testresult.xml, all dynamically added methods have the same name! Somehow the names shown in NUnit GUI are ignored when the xml is generated. Is this an expected behavior? Could someone suggest a workaround?

Here's some code snippets:

public NUnit.Core.Test BuildFrom(System.Reflection.MethodInfo method)
{
string parentName = method.DeclaringType.ToString();
TestSuite suite = new TestSuite(parentName, method.Name);

// BUGBUG: nunit test result xml shows identical names
// for all tests that are dynamically added
int counter = 0;
foreach (string atd_filename in this.definitionFiles)
{
object[] args = new object[4];
args[0] = (object)this.workingDir;
args[1] = (object)atd_filename;
args[2] = (object)this.a;
args[3] = (object)this.d;

// Add test cases
suite.Add(new AvtTestMethod(method,
string.Format("Test({0}) {1}", ++counter,
Path.GetFileNameWithoutExtension(atd_filename)),
args));
}
return suite;
}





-------------------------------------------------------------------------
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=/
Charlie Poole
2008-07-29 23:45:02 UTC
Permalink
What shows up depends on what you put in the test and
the test result. We would need to see how your test
method is defined and whether you are doing anything
special to the test result.

Charlie
-----Original Message-----
Behalf Of Sujin Han
Sent: Tuesday, July 29, 2008 4:04 PM
Subject: [nunit-developer] TestSuite.Add() question
I have created an extension from ITestCaseBuilder. In
BuildFrom method, I instantiate TestSuite and call Add method
to dynamically add a bunch of test cases.
In my test module I use a custom attribute to "trigger" the
creation of these test cases, which all show correctly when
loaded in NUnit.
The problem is that in testresult.xml, all dynamically added
methods have the same name! Somehow the names shown in NUnit
GUI are ignored when the xml is generated. Is this an
expected behavior? Could someone suggest a workaround?
public NUnit.Core.Test BuildFrom(System.Reflection.MethodInfo
method) {
string parentName = method.DeclaringType.ToString();
TestSuite suite = new TestSuite(parentName, method.Name);
// BUGBUG: nunit test result xml shows identical names
// for all tests that are dynamically added
int counter = 0;
foreach (string atd_filename in this.definitionFiles)
{
object[] args = new object[4];
args[0] = (object)this.workingDir;
args[1] = (object)atd_filename;
args[2] = (object)this.a;
args[3] = (object)this.d;
// Add test cases
suite.Add(new AvtTestMethod(method,
string.Format("Test({0}) {1}", ++counter,
Path.GetFileNameWithoutExtension(atd_filename)),
args));
}
return suite;
}
--------------------------------------------------------------
-----------
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
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=/

Kelly Anderson
2008-07-24 17:40:48 UTC
Permalink
I think you're better off reading in an XML file than using
environment variables. The problem is that things are different in
Vista and in that OS environment variables are not convenient.

As for how it should work... that's an interesting question. Because
of all the different places NUnit has to run, something like an XML
file is probably the best for a built in solution as well...

-Kelly
Post by Sujin Han
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=/
Loading...