[nant-dev] NUnit2 task doubt. How can I run ALL test assemblies in the fileset with task-global fail on error?
Hello, nant-developers, I am in doubt. I have a target: target name=tests echo message=Running nunit2 task / !-- //TODO: find a way to run all tests with global fail -- nunit2 haltonfailure=${ nunit2.haltonfailure} failonerror=${nunit2.failonerror} formatter type=Xml usefile=true extension=.xml outputdir=${this.branchPath}${this.testsDir }Results / formatter type=Plain usefile=false / test haltonfailure=${test.haltonfailure} assemblies refid=test.assemblies / /test /nunit2 /target There are 3 assemblies in the test.assemlies refid.The 1st is green, other two are red. I want to run all the test assemblies in the refid without halt on first failand have the target failed if at least one test assembly is red.I have tried all possible combinations of documented attributes. (see http://nant.sourceforge.net/release/latest/help/tasks/nunit2.html )The result I need naturally would be the 2nd combination line. -│${test.haltfailure}│ ${ nunit2.haltonfailure}│${nunit2.failonerror}││halts on first fail│target result │---++-++---+-│ false │ false │ false ││ false │SUCCEEDED │false │ false │ true ││ false (naturally) │SUCCEEDED (!!! naturally expected FAILED with 2 error(s) !!!)│ false │ true │ false ││ true │SUCCEEDED - 1 non-fatal error(s), 0 warning(s) │false │ true │ true ││ true │FAILED │ ---++-++---+-│true │ false │ false ││ true │SUCCEEDED - 1 non-fatal error(s), 0 warning(s) │ true │ false │ true ││ true │FAILED │true │ true │ false ││ true │SUCCEEDED - 1 non-fatal error(s), 0 warning(s) │ true │ true │ true ││ true │FAILED │---LL-LL---L-│ How can I achieve the goal?Is this an issue or a bug or am I a stupid?Is there a documented way a hack or workaround? I have tried this on the following versions:-NAnt 0.85 (Build 0.85.1932.0; rc3; 4/16/2005)NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006)- -Best regards, Alexey 0 Moudrick= - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers
[nant-dev] nunit2 task
I all, I've just installed the very last version of mono and I've some troubles with the nuint2 task... Here below is the error message I get: ** (/usr/local/share/NAnt/bin/NAnt.exe:15021): WARNING **: Could not find assembly nunit.framework, references from /home/genius/projects/gekkota/build/ gekkota-0.4-debug/lib/Gekkota.Tests.dll (assemblyref_index=2) Major/Minor: 2,2 Build: 0,0 Token: 96d09a1eb7f44a77 System error: No such file or directory BUILD FAILED /home/genius/projects/gekkota/src/Gekkota/Gekkota.build(207,6): Failure executing test(s). If you assembly is not built using NUnit version 2.2.0.0, then ensure you have redirected assembly bindings. Consult the documentation of the nunit2 task for more information. Assembly 2 referenced from assembly /home/genius/projects/gekkota/build/ gekkota-0.4-debug/lib/Gekkota.Tests.dll not found Total time: 5.7 seconds. Note that I've copied all the nunit*.dll assemblies from /usr/local/share/NAnt/bin/lib/mono/2.0 to /usr/lib/mono/2.0, and as you can see here below, my build file should be correct: ... property name=target.framework value=${framework::get-target-framework()} / property name=assembly.dir value=${framework::get-assembly-directory(target.framework)} / ... target name=test depends=build description=Tests the current configuration csc target=library output=${build.dir}/lib/${assembly}.Tests.dll sources basedir=${assembly}.Tests failonempty=true include name=*.cs / /sources references include name=${build.dir}/lib/${assembly}.dll / include name=${assembly.dir}/nunit.framework.dll / /references /csc nunit2 formatter type=Plain / formatter type=Xml usefile=true extension=.xml outputdir=${build.dir}/test-results / test assemblyname=${build.dir}/lib/${assembly}.Tests.dll / /nunit2 /target Any idea? j3d. -- Giuseppe Greco ::agamura:: phone: +41 (0)91 604 67 65 mobile: +41 (0)79 602 99 27 email: [EMAIL PROTECTED] web:www.agamura.com --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers
[nant-dev] NUnit2 task with multiple assemblies
I've been using the NUnit2 task as part of an automated build procedure to run the tests in multiple assemblies and report the results, as follows: nunit2 haltonfailure=false failonerror=true formatter type=Plain / test basedir=${Tests.dir} haltonfailure=false assemblies includes name=**\**Tests.dll / /assemblies /test /nunit2 According to the documentation, I believe the following should happen: Nunit2.haltonfailure=false means that all test elements will be completed, even if tests fail. Nunit2.failonerror=true means that the build will fail if any of the tests fail Test.haltonfailure=false means that all of the tests in the test element will run, even if there are failures. What actually happens is that test.haltonfailure only takes effect within a given test assembly, and the moment a test fails a BuildException is raised, which prevents all of the other tests in the other assemblies being run. The functionality of nunit2.haltonfailure is identical to test.haltonfailure, which is counter-intuitive. I propose altering this functionality so that all tests in all assemblies are run before the exception is raised. This should be as simple as setting a boolean if a test fails and then checking the boolean at the end of the foreach loop. Any thoughts on this? Michael Luke --- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag--drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl ___ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers
RE: [nant-dev] NUnit2 Task - How do I get this task to work?
Bruce, I don't modify the configuration file - so I can't help you there. Here is the code that I use: target name=UnitTest depends=Build description=Execute unit tests using NUnit foreach item=File property=filename in items include name=${RootDir.Solution}\**\bin\**\*.UnitTests.dll / /items /in do echo message=Executing unit tests in '${filename}' / nunit2 formatter type = Xml extension=.xml usefile=true outputdir=${RootDir.Builds}\Tests / test assemblyname=${filename} fork=false / /nunit2 /do /foreach /target for each unit test assembly, I run Nunit and have the output written to an xml file in the Tests directory I hope this helps. Noel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruce Leggett Sent: Thursday, July 08, 2004 6:15 AM To: Nant-Developer List Subject:[nant-dev] NUnit2 Task - How do I get this task to work? To all NAnt developers and users, I'm trying to use the NUnit2 task to test VB.NET code during my build. I've tried several different routes to get the task to work with no success. I don't really understand the documentation when it sais, you must add the following node to your test config file. Does that mean your .nunit file? The code to add is as follows: configuration ... runtime assemblyBinding xmlns=urn:schemas-microsoft-com:asm.v1 dependentAssembly assemblyIdentity name=nunit.framework publicKeyToken=96d09a1eb7f44a77 culture=Neutral / bindingRedirect oldVersion=2.0.6.0 newVersion=2.1.4.0 / /dependentAssembly /assemblyBinding /runtime ... /configuration I tried adding that without the ... characters in my .nunit file. See below: NUnitProject Settings activeconfig=Debug / Config name=Debug binpathtype=Auto assembly path=ProjectName.Subject.dll / /Config Config name=Release binpathtype=Auto assembly path=ProjectName.Subject.dll / /Config configuration runtime assemblyBinding xmlns=urn:schemas-microsoft-com:asm.v1 dependentAssembly assemblyIdentity name=nunit.framework publicKeyToken=96d09a1eb7f44a77 culture=Neutral / bindingRedirect oldVersion=2.0.6.0 newVersion=2.1.4.0 / /dependentAssembly /assemblyBinding /runtime /configuration /NUnitProject This is how I set up my NUnit2 task: (The .nunit file is in the output directory) nunit2 verbose=true formatter type=Xml / test assemblies includesfile name=${staging.output}\ProjectName.Subject.nunit / /assemblies /test /nunit2 I've also tried using the assemblies (dll) files. But I get errors both ways. Here is the error, in brief, that I get using the method above: task name=nunit2 / /target failure internalerror typeSystem.ArgumentException/type message ![CDATA[ Illegal characters in path. ]] /message stacktrace ![CDATA[ at System.IO.Path.GetFileName(String path) at NAnt.NUnit2.Types.NUnit2Test.get_TestAssemblies() Someone please tell me what I'm doing wrong. I appreciate any help or hints. Thank You, Bruce Leggett --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers --- This SF.Net email sponsored by Black Hat Briefings Training. Attend Black Hat Briefings Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
[nant-dev] NUnit2 task problems with config files and Framework 1.1
Still learning as we go with this continuous integration project... To fix the problem of PInvoke and its metadata (or whatever), I have to add the following to nunit-console.exe.config: startup supportedRuntime version=v1.1.4322 / /startup [Found on http://weblogs.asp.net/JAvery/posts/5892.aspx. Thanx, James.] M$ changed some major thangs with XML, especially config files and tag parsers (not the first time we've been bitten here) in the 1.1 change... However, NAnt doesn't seem to respect the nunit-console.config file (hoping I've simply overlooked something significant with regards to Framework version config for the NAnt2 task). This is a big problem for us, since we keep all of our tests' configuration (connection strings and such) in external files assemblyname.dll.config files, so I'll make time to look into the NUnit2 code if nobody has a quick answer on the subject. This is all that I can get out of NAnt in verbose on the subject: BUILD FAILED NUnit 2.0 Error: Exception has been thrown by the target of an invocation. The problem is documented elsewhere to be fixed by the above config entry and running the tests directly using nunit-console without the necessary modification results in much more helpful stuff (NOTE: nunit-console.exe works like a charm with the appropriate config modification): NUnit version 2.0.6 Copyright (C) 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved. Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --- System.Configuration.Configurat ionException: Error loading XML file c:\windows\microsoft.net\framework\v1.0.370 5\Config\machine.config Request for the permission of type System.Security.Permi ssions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutr al, PublicKeyToken=b77a5c561934e089 failed. (c:\windows\microsoft.net\framework\ v1.0.3705\Config\machine.config) at System.Configuration.ConfigurationRecord.OpenXmlTextReader(String configFi leName) at System.Configuration.ConfigurationRecord.Load(String filename) at System.Configuration.DefaultConfigurationSystem.System.Configuration.IConf igurationSystem.Init() at System.Configuration.ConfigurationSettings.SetConfigurationSystem(IConfigu rationSystem configSystem) at System.Configuration.ConfigurationSettings.GetConfig(String sectionName) at System.Configuration.ConfigurationSettings.get_AppSettings() at eRealty.Desktop.AppointmentCalendar.TestCalendarUserControl..ctor() in c:\ build\desktop\appointmentcalendar\Calendar.ascx.cs:line 33 --- End of inner exception stack trace --- Server stack trace: at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invok eAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinder Default) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, B inder binder, Object[] parameters, CultureInfo culture) at NUnit.Core.TestSuiteBuilder.BuildTestFixture(Type fixtureType) at NUnit.Core.TestSuiteBuilder.Build(String assemblyName) at NUnit.Core.RemoteTestRunner.BuildSuite() at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInC ontext, Object[] outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes sage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req Msg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData msgDa ta, Int32 type) at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) at NUnit.Framework.TestDomain.MakeRemoteTestRunner(FileInfo file, AppDomain r unnerDomain) at NUnit.Framework.TestDomain.Load(String assemblyFileName) at NUnit.Console.ConsoleUi.MakeTestFromCommandLine(TestDomain testDomain, Com mandLineParser parser) at NUnit.Console.ConsoleUi.Main(String[] args)
[nant-dev] NUnit2 Task Support?
Hello all, I am trying to use the nunit2 task for running my tests from my NAnt build file. I can't seem to get it to work. It keeps complaining about now being able to find nunit.framework.dll, even though I have tried putting it everywhere. Here is my target: target name=test depends=package nunit2 test assemblyname=DotNetMock.Tests.dll/ /nunit2 /target That's it. I have tried adding references to the task. Anyone have any ideas? -Griffin __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers