Re: Load test dll dynamically at runtime
"Charlie Poole" <[email protected]> Tue, 26 Aug 2008 12:34:39 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <006101c907b2$c94e1300$6401a8c0@ferrari> |
That's a clever approach, but if the motivation is to avoid the time it takes for NUnit to load the assembly, it doesn't do the job. I really can't imagine any way to get NUnit to load assemblies without taking the time it takes to do it. :-) However, I guess it's already clear that I don't understand the question.:-) Charlie > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf > Of Eric Mangold > Sent: Tuesday, August 26, 2008 11:11 AM > To: [email protected] > Cc: [email protected] > Subject: Re: [Nunit-users] Load test dll dynamically at runtime > > If there is no good API to use for this, then you could do > the following: > > Configure NUnit settings to automatically run the test suite > once it is loaded. > > Copy the DLL that you wish to test to a TEMPORARY path, and > launch NUnit with that path. The DLL will be loaded and tests > will run. > > Now simply copy different DLLs (as per user interaction) to > that same temp path. NUnit will notice the change on disk and > will reload the DLL and execute the tests (shouldn't matter > that it is an entirely different assembly). > > -Eric Mangold > > On Tue, Aug 26, 2008 at 6:10 AM, > <[email protected]> wrote: > > > > Yes, I saw that there are many options while invoking the nunit.exe > > and supplying the command line parameters. Generally the nunit.exe > > takes around > > 5-7 seconds for complete invocation and loading of the > particular dll. > > It would be the last option I would want to revert to beacuse > > switching between dlls from the wrapper application can be done > > immediately and I was hoping to quickly load that dll loading Nunit. > > > > This is why I dont want to kill and restart the nunit.exe > once loaded > > by the application. I am looking for any way (may be through some > > methods or API from the Nunit) to be able to change the dll > without resarting the exe. > > > > Regards, > > Grishma Khandwalla > > > > > > > > > > > > "Schnick, Michael" <[email protected]> > > > > 08/26/2008 03:56 PM > > > > To > > <[email protected]>, "Tom Fanning" > > <[email protected]> cc <[email protected]> > > Subject > > RE: [Nunit-users] Load test dll dynamically at runtime > > > > > > > > > > Is there any reason why you cannot use the actually > nunit.exe (which > > provides the kind of GUI you describe). > > It seems to support some command-line parameters that > indicate which > > DLL should be loaded (inputfile parameter). > > > > Calling this program from the wrapper script / wrapper application > > should bring you forward. > > Is the start time of nunit.exe really too long? Is start > time of the > > GUI that crucial (compared to the length of the tests)? > > > > Best regards > > Michael > > > > > > ________________________________ > > From: [email protected] > > [mailto:[email protected]] On Behalf Of > > [email protected] > > Sent: Dienstag, 26. August 2008 12:22 > > To: Tom Fanning > > Cc: [email protected] > > Subject: Re: [Nunit-users] Load test dll dynamically at runtime > > > > > > Tom, > > > > I invoke the GUI from the wrapper application which in > short decides > > which dll is to be invoked for testing. On the GUI it gives > the user > > (end > > customer) the option to select the testcases, run and re-run the > > failed test cases and options like that. Also, all my test related > > data is displayed on the Console.Out and Console.Error tabs. > > > > Hence, I need some way out without touching the already > written test > > code with the Nunit GUI. > > > > Thanks, > > > > Grishma > > > > "Tom Fanning" <[email protected]> > > > > 08/26/2008 03:39 PM > > > > To > > <[email protected]> > > cc > > > > Subject > > RE: [Nunit-users] Load test dll dynamically at runtime > > > > > > > > > > > > > > > > Hi Grisma > > > > Sorry for the mess my company's signature has made of the > formatting. > > > > Any particular reason you need to use the GUI? > > > > Thanks > > Tom > > > > > > From: [email protected] > > [mailto:[email protected]] > > Sent: 26 August 2008 10:12 > > To: Tom Fanning > > Cc: [email protected] > > Subject: RE: [Nunit-users] Load test dll dynamically at runtime > > > > Hi Tom, > > > > I need to use specifically the nunit.exe for its GUI. > > > > Thanks, > > > > Regards, > > Grishma Khandwalla > > > > > > "Tom Fanning" <[email protected]> > > 08/26/2008 02:18 PM > > To > > <[email protected]>, <[email protected]> > > cc > > > > Subject > > RE: [Nunit-users] Load test dll dynamically at runtime > > > > > > Check out nunit-console.exe, included in the nunit installation. > > > > Thanks > > Tom > > > > > > > > From: [email protected] > > [mailto:[email protected]] On Behalf Of > > [email protected] > > Sent: 26 August 2008 06:32 > > To: Charlie Poole; [email protected] > > Subject: Re: [Nunit-users] Load test dll dynamically at runtime > > > > > > Thanks Charlie for the quick response.. > > > > I think I did a bad job at specifying the problem. I want to > > automatically launch the nunit.exe, load the dll > programmatically and > > run it (without user intervention like selecting the > assembly from the > > file menu). I agree that multiple dlls can be loaded and > executed, but > > from all the dlls present only one dll is to be loaded and > executed at > > a time (as per user's choice done initially during > configuration. This > > can be in an XML file for Nunit to automatically read, load the > > corresponding dll and run). At a time only one dll is running. I do > > not want to show the other dlls as it would seem that all > dlls can be run one after the other which is not possible. > > > > Could you point me to any specific API's from the Nunit dll like > > nunit.core or something whose methods can help me achieve > this functionality. > > > > Another approach that I was trying was to combine all the test dll > > methods into one dll having different test suites. This can > be loaded > > in nunit.exe and the part I got stuck on was how to include or > > exclude certain test suite without restarting the nunit.exe. > > Restarting is not an option coz it will lead to delays > while exiting and loading the dll again. > > > > I hope you getting the essence here. My aim is to achieve as much > > automation possible. > > > > Thanks in advance, > > > > Regards, > > Grishma Khandwalla > > "Charlie Poole" <[email protected]> Sent by: > > [email protected] > > 08/25/2008 10:43 PM > > > > To > > <[email protected]>, <[email protected]> > > cc > > > > Subject > > Re: [Nunit-users] Load test dll dynamically at runtime > > > > > > > > > > > > > > > > > > > > > > Of course, I may not have understood your question, but it > seems that > > NUnit already does what you want. > > > > The user can use File | Open to navigate to a particular > assembly and > > open it. > > > > Dlls are closed from the menu or when loading a new one. > > > > NUnit also supports loading multiple dlls. > > > > If I misunderstood, please try again. :-) > > > > Charlie > > > > > > > > Employment Law Advisory Services Ltd > > Tom Fanning > > Senior Developer > > Charles House > > Albert Street > > Eccles > > Manchester > > M30 0PW > > Email: [email protected] > > Web: www.employment-law.uk.com > > Tel: 0161 785 2000 > > Fax: 0161 787 7335 > > > > -------------------------------------------------------- > > > > This message contains confidential information and is intended only > > for [email protected]. If you are not > > [email protected] you should not disseminate, > distribute > > or copy this e-mail. Please notify [email protected] > > immediately by e-mail if you have received this e-mail by > mistake and > > delete this e-mail from your system. E-mail transmission cannot be > > guaranteed to be secure or error-free as information could be > > intercepted, corrupted, lost, destroyed, arrive late or > incomplete, or > > contain viruses. Tom Fanning therefore does not accept > liability for > > any errors or omissions in the contents of this message, > which arise as a result of e-mail transmission. > > > > Reg No. - 3041461 VAT No. - 628 8052 25 > > -------------------------------------------------------- > > > > ________________________________________ > > > > > > From: [email protected] > > [mailto:[email protected]] On Behalf Of > > [email protected] > > Sent: Monday, August 25, 2008 6:20 AM > > To: [email protected] > > Subject: [Nunit-users] Load test dll dynamically at runtime > > > > > > > > Hi, > > > > I am using Nunit 2.4.7. I have many .dll files which > contain a number > > of test cases. I was trying to develop an application which would > > allow the user to choose the .dll file whose test cases are > then executed. > > > > I am using the Nunit GUI, which is instantiated when the > application > > is initialized. I was wondering if there is any option to > unload the > > current dll from the nunit.exe and load the new dll > (selected by the > > user) into the same nunit.exe? (without using the manual > > intervention). I specifically do not want to close the GUI > and open it > > again. Nor can multiple .exe files can be invoked. > > > > I was playing around the idea of combining all the test > cases across > > multiple dlls into a single dll, but again I have no leads > on how to > > dynamically mask and unmask certain suite of test cases without > > restarting the Nunit exe. > > > > Any help would be appreciated, > > > > Regards, > > Grishma Khandwalla > > > ---------------------------------------------------------------------- > > --- 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-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/nunit-users > > > > > ---------------------------------------------------------------------- > > --- 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-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/nunit-users > > > > > > -------------------------------------------------------------- > ----------- > 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-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/nunit-users > ------------------------------------------------------------------------- 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=/