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

Commit9363731

Browse files
committed
Use built-from-source diff tool
1 parent753b1de commit9363731

File tree

7 files changed

+143
-20
lines changed

7 files changed

+143
-20
lines changed

‎tests/BuildTestTools.cmd‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if not exist "%~dp0\fsharpqa\testenv\bin" mkdir "%~dp0\fsharpqa\testenv\bin" ||
1515
msbuild%~dp0\fsharpqa\testenv\src\ILComparer\ILComparer.fsproj /p:Configuration=%1 /t:Build||goto :error
1616
xcopy /Y%~dp0\fsharpqa\testenv\src\ILComparer\bin\%1\*%~dp0\fsharpqa\testenv\bin||goto :error
1717

18+
msbuild%~dp0\fsharpqa\testenv\src\diff\diff.fsproj /p:Configuration=%1 /t:Build||goto :error
19+
xcopy /Y%~dp0\fsharpqa\testenv\src\diff\bin\%1\*%~dp0\fsharpqa\testenv\bin||goto :error
20+
1821
msbuild%~dp0\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj /p:Configuration=%1 /t:Build||goto :error
1922
xcopy /Y%~dp0\fsharpqa\testenv\src\HostedCompilerServer\bin\%1\*%~dp0\fsharpqa\testenv\bin||goto :error
2023

‎tests/config.bat‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ REM add %FSCBinPath% to path only if not already there. Otherwise, the path keep
2626
echo%path%;|find /i"%FSCBinPath%;">NUL
2727
ifERRORLEVEL1setPATH=%PATH%;%FSCBinPath%
2828

29-
if"%FSDIFF%"==""setFSDIFF=%SCRIPT_ROOT%fsharpqa\testenv\bin\%processor_architecture%\diff.exe -dew
29+
if"%FSDIFF%"==""setFSDIFF=%SCRIPT_ROOT%fsharpqa\testenv\bin\diff.exe
30+
ifnotexist"%FSDIFF%"echo FSDIFF not found at expected path of%fsdiff%&&exit /b1
3031

3132
rem check if we're already configured, if not use the configuration from the last line of the config file
3233
if"%fsc%"=="" (

‎tests/fsharp/core/printing/build.bat‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ if NOT "%FSC:NOTAVAIL=X%" == "%FSC%" (
1212
goto Skip
1313
)
1414

15-
rem recall>fred.txt 2>&1 merges stderr into the stdout redirect
16-
rem however 2>&1>fred.txt did not seem to do it.
17-
18-
REM Here we use diff.exe without -dew option to trap whitespace changes, like bug 4429.
19-
REM Any whitespace change needs to be investigated, these tests are to check exact output.
20-
REM Base line updates are easy: sd edit and delete the .bsl and rerun the test.
21-
setPRDIFF=%~d0%~p0..\..\..\fsharpqa\testenv\bin\%processor_architecture%\diff.exe
22-
echo Diff tool is%PRDIFF%
23-
ifNOTEXIST%PRDIFF% (
24-
echo ERROR: Diff tool not found at%PRDIFF%
25-
exit /b1
26-
)
27-
2815
echo == Plain
2916
"%FSI%"%fsc_flags_errors_ok% --nologo<test.fsx>z.raw.output.test.default.txt2>&1
3017
echo == PrintSize1000
@@ -50,11 +37,11 @@ if NOT EXIST z.output.test.1000.bsl COPY z.output.test.1000.txt z.output.t
5037
ifNOTEXIST z.output.test.200.bslCOPY z.output.test.200.txt z.output.test.200.bsl
5138
ifNOTEXIST z.output.test.quiet.bslCOPY z.output.test.quiet.txt z.output.test.quiet.bsl
5239

53-
%PRDIFF% z.output.test.default.txt z.output.test.default.bsl> z.output.test.default.diff
54-
%PRDIFF% z.output.test.off.txt z.output.test.off.bsl> z.output.test.off.diff
55-
%PRDIFF% z.output.test.1000.txt z.output.test.1000.bsl> z.output.test.1000.diff
56-
%PRDIFF% z.output.test.200.txt z.output.test.200.bsl> z.output.test.200.diff
57-
%PRDIFF% z.output.test.quiet.txt z.output.test.quiet.bsl> z.output.test.quiet.diff
40+
%FSDIFF% z.output.test.default.txt z.output.test.default.bsl> z.output.test.default.diff
41+
%FSDIFF% z.output.test.off.txt z.output.test.off.bsl> z.output.test.off.diff
42+
%FSDIFF% z.output.test.1000.txt z.output.test.1000.bsl> z.output.test.1000.diff
43+
%FSDIFF% z.output.test.200.txt z.output.test.200.bsl> z.output.test.200.diff
44+
%FSDIFF% z.output.test.quiet.txt z.output.test.quiet.bsl> z.output.test.quiet.diff
5845

5946
echo ======== Differences From ========
6047
TYPE z.output.test.default.diff
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FSharp.Compiler.*
22
FSharp.Core.*
33
HostedCompilerServer.*
4-
ILComparer.*
4+
ILComparer.*
5+
diff.*
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntimeversion="v4.0"sku=".NETFramework,Version=v4.5" />
5+
</startup>
6+
</configuration>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
openSystem
2+
openSystem.IO
3+
4+
[<EntryPoint>]
5+
letmain args=
6+
letpath1,path2=
7+
match argswith
8+
|[| arg1; arg2|]->
9+
if File.Exists(arg1)&& File.Exists(arg2)then arg1, arg2
10+
else printfn"Invalid paths"; exit1
11+
|_->
12+
printfn"Usage:"
13+
printfn" diff.exe <file1> <file2>"
14+
exit1
15+
16+
letlines1= File.ReadAllLines(path1)
17+
letlines2= File.ReadAllLines(path2)
18+
19+
letminLines= min lines1.Length lines2.Length
20+
21+
for i=0to(minLines-1)do
22+
if lines1.[i]<> lines2.[i]then
23+
printfn"diff between [%s] and [%s]" path1 path2
24+
printfn"line%d"(i+1)
25+
printfn" -%s" lines1.[i]
26+
printfn" +%s" lines2.[i]
27+
exit1
28+
29+
if lines1.Length<> lines2.Lengththen
30+
printfn"diff between [%s] and [%s]" path1 path2
31+
printfn"diff at line%d" minLines
32+
lines1.[minLines..(lines1.Length-1)]|> Array.iter(printfn"-%s")
33+
lines2.[minLines..(lines2.Length-1)]|> Array.iter(printfn"+%s")
34+
exit1
35+
36+
0
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectToolsVersion="12.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportProject="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<ConfigurationCondition=" '$(Configuration)' == ''">Debug</Configuration>
6+
<PlatformCondition=" '$(Platform)' == ''">AnyCPU</Platform>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>4239efea-e746-446a-bf7a-51fcbab13946</ProjectGuid>
9+
<OutputType>Exe</OutputType>
10+
<RootNamespace>FSharp.Test.Diff</RootNamespace>
11+
<AssemblyName>diff</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<OpenBuildCondition=" '$(OpenBuild)' == ''">True</OpenBuild>
15+
<OpenDrop>..\..\..\..\..\$(Configuration)\net40\bin</OpenDrop>
16+
<TargetFSharpCoreVersion>4.3.1.0</TargetFSharpCoreVersion>
17+
<Name>HostedCompilerServer</Name>
18+
</PropertyGroup>
19+
<PropertyGroupCondition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<Tailcalls>false</Tailcalls>
24+
<OutputPath>bin\Debug\</OutputPath>
25+
<DefineConstants>DEBUG;TRACE</DefineConstants>
26+
<WarningLevel>3</WarningLevel>
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DocumentationFile>bin\Debug\ILComparer.XML</DocumentationFile>
29+
<Prefer32Bit>true</Prefer32Bit>
30+
</PropertyGroup>
31+
<PropertyGroupCondition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
32+
<DebugType>pdbonly</DebugType>
33+
<Optimize>true</Optimize>
34+
<Tailcalls>true</Tailcalls>
35+
<OutputPath>bin\Release\</OutputPath>
36+
<DefineConstants>TRACE</DefineConstants>
37+
<WarningLevel>3</WarningLevel>
38+
<PlatformTarget>AnyCPU</PlatformTarget>
39+
<DocumentationFile>bin\Release\ILComparer.XML</DocumentationFile>
40+
<Prefer32Bit>true</Prefer32Bit>
41+
</PropertyGroup>
42+
<ItemGroup>
43+
<ReferenceInclude="mscorlib" />
44+
<ReferenceInclude="System" />
45+
<ReferenceInclude="System.Core" />
46+
<ReferenceInclude="System.Numerics" />
47+
</ItemGroup>
48+
<ItemGroupCondition=" '$(OpenBuild)' == 'True'">
49+
<ReferenceInclude="$(OpenDrop)\FSharp.Core.dll">
50+
<Private>True</Private>
51+
</Reference>
52+
</ItemGroup>
53+
<ItemGroupCondition=" '$(OpenBuild)' != 'True'">
54+
<ReferenceInclude="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
55+
<Private>True</Private>
56+
</Reference>
57+
</ItemGroup>
58+
<ItemGroup>
59+
<CompileInclude="Program.fs" />
60+
<NoneInclude="App.config" />
61+
</ItemGroup>
62+
<PropertyGroup>
63+
<MinimumVisualStudioVersionCondition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
64+
</PropertyGroup>
65+
<Choose>
66+
<WhenCondition="'$(VisualStudioVersion)' == '11.0'">
67+
<PropertyGroupCondition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') AND '$(OpenBuild)' != 'True'">
68+
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
69+
</PropertyGroup>
70+
</When>
71+
<Otherwise>
72+
<PropertyGroupCondition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') AND '$(OpenBuild)' != 'True'">
73+
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
74+
</PropertyGroup>
75+
<PropertyGroupCondition=" '$(OpenBuild)' == 'True'">
76+
<FscToolPath>$(OpenDrop)</FscToolPath>
77+
<FSharpTargetsPath>$(OpenDrop)\Microsoft.FSharp.targets</FSharpTargetsPath>
78+
</PropertyGroup>
79+
</Otherwise>
80+
</Choose>
81+
<ImportProject="$(FSharpTargetsPath)" />
82+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
83+
Other similar extension points exist, see Microsoft.Common.targets.
84+
<Target Name="BeforeBuild">
85+
</Target>
86+
<Target Name="AfterBuild">
87+
</Target>
88+
-->
89+
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp