Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited4a32f

Browse files
committed
Use nuget-obtained NUnit everywhere, seamlessly
1 parent468487f commited4a32f

File tree

5 files changed

+33
-54
lines changed

5 files changed

+33
-54
lines changed

‎appveyor-build.cmd‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,38 @@ if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :eof
2727

2828
%_ngenexe% install lib\proto\fsc-proto.exe
2929

30-
%_msbuildexe% src/fsharp-library-build.proj /p:UseNugetPackages=true
30+
%_msbuildexe% src/fsharp-library-build.proj
3131
@if ERRORLEVEL1echo Error: library debug build failed&&goto :eof
3232

33-
%_msbuildexe% src/fsharp-compiler-build.proj /p:UseNugetPackages=true
33+
%_msbuildexe% src/fsharp-compiler-build.proj
3434
@if ERRORLEVEL1echo Error: compile debug build failed&&goto :eof
3535

3636
REM We don't build new net20 FSharp.Core anymore
37-
REM %_msbuildexe% src/fsharp-library-build.proj /p:UseNugetPackages=true /p:TargetFramework=net20
37+
REM %_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=net20
3838
REM @if ERRORLEVEL 1 echo Error: library net20 debug build failed && goto :eof
3939

40-
%_msbuildexe% src/fsharp-library-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable47
40+
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47
4141
@if ERRORLEVEL1echo Error: library portable47 debug build failed&&goto :eof
4242

43-
%_msbuildexe% src/fsharp-library-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable7
43+
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable7
4444
@if ERRORLEVEL1echo Error: library portable7 debug build failed&&goto :eof
4545

46-
47-
%_msbuildexe% src/fsharp-library-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable78
46+
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable78
4847
@if ERRORLEVEL1echo Error: library portable78 debug build failed&&goto :eof
4948

50-
%_msbuildexe% src/fsharp-library-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable259
49+
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable259
5150
@if ERRORLEVEL1echo Error: library portable259 debug build failed&&goto :eof
5251

53-
54-
55-
5652
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:UseNugetPackages=true
5753
@if ERRORLEVEL1echo Error: library unittests debug build failed&&goto :eof
5854

59-
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable47
55+
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47
6056
@if ERRORLEVEL1echo Error: library unittests debug build failed portable47&&goto :eof
6157

62-
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable7
58+
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7
6359
@if ERRORLEVEL1echo Error: library unittests debug build failed portable7&&goto :eof
6460

65-
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:UseNugetPackages=true /p:TargetFramework=portable78
61+
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78
6662
@if ERRORLEVEL1echo Error: library unittests debug build failed portable78&&goto :eof
6763

6864

@@ -90,6 +86,3 @@ call RunTests.cmd debug coreunit
9086
@if ERRORLEVEL1echo Error: 'RunTests.cmd debug coreunit' failed&&goto :eof
9187

9288
popd
93-
94-
95-

‎src/FSharpSource.targets‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,4 +740,7 @@
740740
<CompileBeforeRemove="@(CompileBefore)"/>
741741
</ItemGroup>
742742
</Target>
743+
<TargetName="BeforeBuild"BeforeTargets="Build">
744+
<ExecCommand=".\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages"WorkingDirectory="$(FSharpSourcesRoot)\.."/>
745+
</Target>
743746
</Project>

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
<Optimize>false</Optimize>
2121
<Tailcalls>false</Tailcalls>
2222
<TargetProfileCondition=" '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259'">netcore</TargetProfile>
23-
<!-- workaround for msbuild narrowing the assembly search paths when building portable libs-->
24-
<AssemblySearchPathsCondition="$(TargetFramework.Contains('portable'))">
25-
{CandidateAssemblyFiles};
26-
{TargetFrameworkDirectory};
27-
{Registry:Software\Microsoft\.NETFramework,v4.5,AssemblyFoldersEx};
28-
</AssemblySearchPaths>
2923
</PropertyGroup>
3024
<PropertyGroup>
3125
<DefineConstantsCondition=" '$(TargetFramework)' == 'sl5'">$(DefineConstants);SILVERLIGHT</DefineConstants>
@@ -52,6 +46,7 @@
5246
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47-->
5347
<ReferenceInclude="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
5448
<SpecificVersion>true</SpecificVersion>
49+
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
5550
</Reference>
5651
<ReferenceInclude="NUnitFramework"Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
5752
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
@@ -110,10 +105,4 @@
110105
<CompileInclude="SurfaceArea.$(TargetFramework).fs" />
111106
</ItemGroup>
112107
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />
113-
<TargetName="BeforeResolveReferences"Condition="'$(UseNugetPackages)'=='true'">
114-
<CreatePropertyValue="$(ProjectDir)..\..\..\packages\NUnit.2.6.3\lib\;$(AssemblySearchPaths)">
115-
<OutputTaskParameter="Value"
116-
PropertyName="AssemblySearchPaths" />
117-
</CreateProperty>
118-
</Target>
119108
</Project>

‎tests/RunTests.cmd‎

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ IF NOT DEFINED APPVEYOR_CI (
4343
rem path to fsc.exe which will be used by tests
4444
setFSCBINPATH=%~dp0..\%FLAVOR%\net40\bin
4545

46+
rem path to nunit runners
47+
setNUNITDIR=%~dp0..\packages\NUnit.Runners.2.6.3\tools
48+
ifnotexist"%NUNITDIR%" (
49+
pushd%~dp0..
50+
.\.nuget\nuget.exe restore packages.config -PackagesDirectory packages
51+
popd
52+
)
53+
4654
rem folder where test logs/results will be dropped
4755
setRESULTSDIR=%~dp0\TestResults
4856
ifnotexist"%RESULTSDIR%" (mkdir"%RESULTSDIR%")
@@ -182,13 +190,8 @@ set XMLFILE=CoreUnit_%coreunitsuffix%_Xml.xml
182190
setOUTPUTFILE=CoreUnit_%coreunitsuffix%_Output.log
183191
setERRORFILE=CoreUnit_%coreunitsuffix%_Error.log
184192

185-
where.exe nunit-console.exe>NUL2>NUL
186-
iferrorlevel1 (
187-
echo Error: nunit-console.exe is not in the PATH
188-
exit /b1
189-
)
190-
echo nunit-console.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
191-
nunit-console.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
193+
echo"%NUNITDIR%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
194+
"%NUNITDIR%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%coreunitsuffix%\bin\FSharp.Core.Unittests.dll
192195

193196
goto :EOF
194197

@@ -198,13 +201,8 @@ set XMLFILE=ComplierUnit_%compilerunitsuffix%_Xml.xml
198201
setOUTPUTFILE=ComplierUnit_%compilerunitsuffix%_Output.log
199202
setERRORFILE=ComplierUnit_%compilerunitsuffix%_Error.log
200203

201-
where.exe nunit-console.exe>NUL2>NUL
202-
iferrorlevel1 (
203-
echo Error: nunit-console.exe is not in the PATH
204-
exit /b1
205-
)
206-
echo nunit-console.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%compilerunitsuffix%\bin\FSharp.Compiler.Unittests.dll
207-
nunit-console.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%compilerunitsuffix%\bin\FSharp.Compiler.Unittests.dll
204+
echo"%NUNITDIR%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%compilerunitsuffix%\bin\FSharp.Compiler.Unittests.dll
205+
"%NUNITDIR%\nunit-console.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\..\..\%compilerunitsuffix%\bin\FSharp.Compiler.Unittests.dll
208206

209207
goto :EOF
210208

@@ -214,16 +212,9 @@ set XMLFILE=IDEUnit_Xml.xml
214212
setOUTPUTFILE=IDEUnit_Output.log
215213
setERRORFILE=IDEUnit_Error.log
216214

217-
where.exe nunit-console-x86.exe>NUL2>NUL
218-
iferrorlevel1 (
219-
echo Error: nunit-console-x86.exe is not in the PATH
220-
exit /b1
221-
)
222-
223-
for /f"tokens=*"%%ain ('where.exe nunit-console-x86.exe')do (set nunitlocation=%%~dpa)
224-
xcopy /y"%nunitlocation%\lib\*.dll""%FSCBINPATH%"
215+
xcopy /y"%NUNITDIR%\lib\*.dll""%FSCBINPATH%"
225216

226-
echo nunit-console-x86.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\Unittests.dll
227-
nunit-console-x86.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\Unittests.dll
217+
echo"%NUNITDIR%\nunit-console-x86.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\Unittests.dll
218+
"%NUNITDIR%\nunit-console-x86.exe" /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%RESULTSDIR%%FSCBINPATH%\Unittests.dll
228219

229220
goto :EOF

‎vsintegration/src/unittests/Unittests.fsproj‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@
112112
<ReferenceInclude="Microsoft.VisualStudio.Designer.Interfaces" />
113113
<ReferenceInclude="Microsoft.VisualStudio.CommonIDE" />
114114
<ReferenceInclude="Microsoft.VisualStudio.VSHelp.dll" />
115-
<ReferenceInclude="nunit.framework.dll" />
115+
<ReferenceInclude="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>
118+
</Reference>
116119
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\Fsc\Fsc.fsproj">
117120
<Project>{ffde9e47-9675-4498-b540-69b2583dd600}</Project>
118121
<Name>Fsc</Name>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp