Skip to content

Commit 1b97683

Browse files
committed
Update unit test projects to use central nunit version
1 parent efc744c commit 1b97683

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
</PropertyGroup>
4545
<ItemGroup>
4646
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47 -->
47-
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
47+
<Reference Include="nunit.framework, Version=$(NUnitFullVersion), Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
4848
<SpecificVersion>true</SpecificVersion>
49-
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
49+
<Private>True</Private>
50+
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
5051
</Reference>
5152
<Reference Include="NUnitFramework" Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
5253
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">

tests/RunTests.cmd

+4-14
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ set HOSTED_COMPILER=1
3939
rem path to fsc.exe which will be used by tests
4040
set FSCBINPATH=%~dp0..\%FLAVOR%\net40\bin
4141

42-
rem path to nunit runners
43-
set NUNITDIR=%~dp0..\packages\NUnit.Runners.2.6.3\tools
44-
if not exist "%NUNITDIR%" (
45-
pushd %~dp0..
46-
.\.nuget\nuget.exe restore packages.config -PackagesDirectory packages
47-
popd
48-
)
49-
5042
rem folder where test logs/results will be dropped
5143
set RESULTSDIR=%~dp0\TestResults
5244
if not exist "%RESULTSDIR%" (mkdir "%RESULTSDIR%")
@@ -182,8 +174,8 @@ set XMLFILE=CoreUnit_%coreunitsuffix%_Xml.xml
182174
set OUTPUTFILE=CoreUnit_%coreunitsuffix%_Output.log
183175
set ERRORFILE=CoreUnit_%coreunitsuffix%_Error.log
184176

185-
echo "%NUNITDIR%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
186-
"%NUNITDIR%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
177+
echo "%NUNITPATH%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
178+
"%NUNITPATH%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
187179

188180
goto :EOF
189181

@@ -193,9 +185,7 @@ set XMLFILE=IDEUnit_Xml.xml
193185
set OUTPUTFILE=IDEUnit_Output.log
194186
set ERRORFILE=IDEUnit_Error.log
195187

196-
xcopy /y "%NUNITDIR%\lib\*.dll" "%FSCBINPATH%"
197-
198-
echo "%NUNITDIR%\nunit-console-x86.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\Unittests.dll
199-
"%NUNITDIR%\nunit-console-x86.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\Unittests.dll
188+
echo "%NUNITPATH%\nunit-console-x86.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\Unittests.dll
189+
"%NUNITPATH%\nunit-console-x86.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR% %FSCBINPATH%\Unittests.dll
200190

201191
goto :EOF

vsintegration/src/Salsa/Salsa.fsproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@
6767
<Reference Include="Microsoft.VisualStudio.VSHelp.dll" />
6868
<Reference Include="Microsoft.VisualStudio.Text.Data" />
6969
<Reference Include="Microsoft.VisualStudio.CoreUtility" />
70-
<Reference Include="nunit.framework" />
70+
<Reference Include="nunit.framework">
71+
<Private>True</Private>
72+
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
73+
</Reference>
74+
<Reference Include="nunit.util">
75+
<Private>True</Private>
76+
<HintPath>$(NunitToolsLibDir)\nunit.util.dll</HintPath>
77+
</Reference>
7178
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
7279
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
7380
<Name>FSharp.Core</Name>

vsintegration/src/unittests/Unittests.fsproj

+7-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@
112112
<Reference Include="Microsoft.VisualStudio.Designer.Interfaces" />
113113
<Reference Include="Microsoft.VisualStudio.CommonIDE" />
114114
<Reference Include="Microsoft.VisualStudio.VSHelp.dll" />
115-
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
116-
<SpecificVersion>true</SpecificVersion>
117-
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
115+
<Reference Include="nunit.util">
116+
<Private>True</Private>
117+
<HintPath>$(NunitToolsLibDir)\nunit.util.dll</HintPath>
118+
</Reference>
119+
<Reference Include="nunit.framework">
120+
<Private>True</Private>
121+
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
118122
</Reference>
119123
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\Fsc\Fsc.fsproj">
120124
<Project>{ffde9e47-9675-4498-b540-69b2583dd600}</Project>

0 commit comments

Comments
 (0)