updating nunit-console on command line
Asked Answered
W

1

5

I am trying to upgrade my nunit-console version 2.4.8 to the latest or at least to version 3. The only help I found online was about Visual Studio and upgrading it there, but I am working on MAC and in my VS it has already the latest version.

I think the way I search for is about nuget on command line like

nuget update nunit-console

but it gives me following error

No packages.config, project or solution file specified. Use the -self switch to update NuGet.exe.

What is the right command or is there an other way I need to go?

Thanks in advance

Watershed answered 18/12, 2017 at 8:44 Comment(0)
J
8

You are trying to update nunit-console that ships with Mono? You cannot update that just by using nuget.

Instead I would just download the NUnit console runner you want to use from nuget and just call that using Mono. A simple way to get the console runner would be to run:

nuget install NUnit.ConsoleRunner

This would download the latest NUnit console runner and extract it to:

NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe

Then either use the above nunit3-console.exe runner directly with mono:

mono full/path/to/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe

Or if you want to have a nunit3-console command then I would look at the existing nunit-console script /Library/Frameworks/Mono.framework/Versions/Current/Commands/nunit-console

#!/bin/sh
exec /Library/Frameworks/Mono.framework/Versions/5.8.0/bin/mono --debug $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/4.5/nunit-console.exe "$@"

Then create your own based on this script but have it use the new NUnit console runner you downloaded.

You may want to put this script somewhere else instead of /Library/Frameworks/Mono.framework/Versions/Current/Commands/ to avoid it being removed when Mono is updated.

Jermaine answered 18/12, 2017 at 12:50 Comment(2)
Almost the same issue. I have nunit 2.4.8 in the GAC ( /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/gac/nunit.framework/2.4.8.0__96d09a1eb7f44a77/nunit.framework.dll ) which conflicts with newer version from nuget when I compile. Following your instructions would only update the runner, what should I do for the .dll in the GAC ?Aerophyte
this still gives an error Either assembly contains no tests or proper test driver has not been found.Televisor

© 2022 - 2024 — McMap. All rights reserved.