Description
Note: The unit testing framework NUnit needs to be installed and nunit-console has to be in the PATH to run this test. Also, NuGet.exe needs to be in the PATH. See : http://www.nunit.org and https://www.nuget.org/ Contributor: Lutz Westermann, March 2015
Small Model of Type : .Net
Category : GAMS API library
Main file : CSNUnit.gms
$title 'Compiles and runs NUnit tests for object oriented C# API' (CSNUNIT,SEQ=50)
$onText
Note: The unit testing framework NUnit needs to be installed and nunit-console
has to be in the PATH to run this test. Also, NuGet.exe needs to be in
the PATH.
See : http://www.nunit.org and https://www.nuget.org/
Contributor: Lutz Westermann, March 2015
$offText
$set srcRoot %gams.sysdir%apifiles%system.dirsep%CSharp%system.dirsep%
$escape &
$if %system.filesys% == UNIX
$if %sysenv.MPATH% == %&sysenv.MPATH%& $abort.noError Need Mono to run this on Unix
$ set BUILD MSBuild.exe
$if %system.filesys% == UNIX $set BUILD $MPATH/xbuild
$ set EXEC nunit3-console.exe
$ set x64
$if %system.platform% == WEX $set x64 x64%system.dirsep%
$if %system.platform% == WEX
$if not set flags $set flags -t:rebuild -p:Configuration=Release -p:Platform="x64"
$if %system.platform% == LEX
$if not set flags $set flags /t:rebuild /p:Configuration=Release
$if %system.platform% == DEX
$if not set flags $set flags /t:rebuild /p:Configuration=Release /p:DefineConstants="__APPLE__"
$if %system.platform% == DAX
$if not set flags $set flags /t:rebuild /p:Configuration=Release /p:DefineConstants="__APPLE__"
$call NuGet.exe restore "%srcRoot%GamsApiTests.sln" -Source https://api.nuget.org/v3/index.json
$if errorlevel 1 $abort 'Problem runnig NuGet'
$call %BUILD% %flags% "%srcRoot%GamsApiTests%system.dirsep%GamsApiTests.csproj"
$if errorlevel 1 $abort 'Problem compiling GamsApiTests'
$onEcho > "%srcRoot%GamsApiTests%system.dirsep%bin\%x64%Release%system.dirsep%test.properties"
gamsVersion = %system.GAMSReleaseMaint%
gamsSystemDir = %gams.sysdir%.
gamsWorkingDir = .
gamsDebugLevel = off
$offEcho
$call %EXEC% --config=Release "%srcRoot%GamsApiTests.sln"
$if errorlevel 1 $abort 'Problem executing GamsApiTests'