Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3 #417

Merged
merged 115 commits into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
1a3186a
add range to MarkdownParagraph and MarkdownSpan
AviAvni Jun 19, 2016
779e9f2
fix active pattern naming by adding StringPosition module
AviAvni Jul 6, 2016
c7f78e7
fix naming
AviAvni Jul 6, 2016
377f5b1
add names to DUs parameters
AviAvni Jul 6, 2016
16383d8
add start/end line/column to markdown range
AviAvni Jul 8, 2016
2b6f7bb
fixes from tomas code review
AviAvni Jul 12, 2016
6ca4b3f
Minor styling and naming tweaks
tpetricek Aug 1, 2016
9087ca2
Beta release
tpetricek Aug 1, 2016
93376c4
Integrate master chnges
tpetricek Aug 3, 2016
d6c89e6
Merge branch 'master' into version3
tpetricek Aug 3, 2016
3b18ef8
Remove Razor reference from FSharp.Literate
Krzysztof-Cieslak Oct 4, 2016
a9e1f11
Use plugable generator function
Krzysztof-Cieslak Oct 4, 2016
1835675
Add generator to ProcessDirectory
Krzysztof-Cieslak Oct 4, 2016
02dbe75
Use record type
Krzysztof-Cieslak Oct 4, 2016
2fd147c
Remove Razor dependency from FSharp.MetadataFormat
Krzysztof-Cieslak Oct 4, 2016
a41cae3
Small fixes to MetadataFormat
Krzysztof-Cieslak Oct 4, 2016
86ad480
Update comment
Krzysztof-Cieslak Oct 4, 2016
d85c84c
Add RazorMetadataFormat
Krzysztof-Cieslak Oct 4, 2016
6d9b0d2
FSharp.Formatting API returns formated data
Krzysztof-Cieslak Oct 5, 2016
02b474e
Add RazorLiterate API
Krzysztof-Cieslak Oct 5, 2016
999b8a6
Fix CommandLineTool
Krzysztof-Cieslak Oct 5, 2016
a48c4c1
Fix tests
Krzysztof-Cieslak Oct 5, 2016
0d5782e
Add F#.Core reference
Krzysztof-Cieslak Oct 5, 2016
31e8320
Update build script and fsproj
Krzysztof-Cieslak Nov 9, 2016
9e4d8c9
Fix docs generation
Krzysztof-Cieslak Nov 9, 2016
fa1f5ea
Update doc generating
Krzysztof-Cieslak Nov 9, 2016
70255a2
Fix ProcessDirectory
Krzysztof-Cieslak Nov 9, 2016
ca6ebac
Fix generate.fsx
Krzysztof-Cieslak Nov 9, 2016
15465b1
fix caching error by invalidating old cache and printing a warning.
matthid Mar 17, 2017
47acc98
Merge pull request #425 from Krzysztof-Cieslak/remove_Razor
matthid Mar 18, 2017
4154739
update sln contents
cloudRoutine Mar 21, 2017
975b6b9
update test infrastructure
cloudRoutine Mar 22, 2017
26c7782
fix test reversal
cloudRoutine Mar 22, 2017
b529526
adjust target resolution
cloudRoutine Mar 22, 2017
3dfb9ec
adjust target resolution again
cloudRoutine Mar 22, 2017
f4b82c0
paket magic mode
cloudRoutine Mar 22, 2017
6bb556c
use nuget FSharp.Core all projects
cloudRoutine Mar 22, 2017
381216e
fix windows build for vs2017/msbuild15 install
cloudRoutine Mar 22, 2017
21eb2f4
cleanup
cloudRoutine Mar 22, 2017
5add72a
Merge pull request #430 from cloudRoutine/version3-tests
matthid Mar 22, 2017
2a128a6
update paket, packages, and FSharp.Core
cloudRoutine Apr 1, 2017
2af8bfe
update packages
cloudRoutine Apr 2, 2017
d835950
additional token categories
cloudRoutine Apr 2, 2017
18b155c
use FCS semantic classification for tokens
cloudRoutine Apr 2, 2017
b346b4d
update packages
cloudRoutine Apr 2, 2017
d5227c3
update css and load paths
cloudRoutine Apr 2, 2017
1dfe1cb
setup editorconfig
cloudRoutine Apr 14, 2017
4ee32b2
formatting and organization
cloudRoutine Apr 14, 2017
63a52a0
update packages
cloudRoutine Apr 14, 2017
c0e9934
more formatting
cloudRoutine Apr 14, 2017
bdc4cf4
update test api usage
cloudRoutine Apr 14, 2017
fab5861
update project files
cloudRoutine Apr 14, 2017
ae51d4a
update paket and bootstrapper
cloudRoutine Apr 14, 2017
f113638
working vs and commandline build
cloudRoutine Apr 14, 2017
bff1198
update FSharp.Core in /lib/
cloudRoutine Apr 15, 2017
3a66f41
change debug version from portable to full
cloudRoutine Apr 15, 2017
fbe9294
Set NUnit to 3.6.0 for FsUnit Compatibility
cloudRoutine Apr 15, 2017
ea013da
update fsunit api calls
cloudRoutine Apr 15, 2017
28bba86
parameterize CSS class names
cloudRoutine Apr 15, 2017
f99d80d
tweak CSS classes
cloudRoutine Apr 15, 2017
2dc2dc5
update fsunit api calls and paramaterize CSS class usage
cloudRoutine Apr 15, 2017
529c4fb
formatting
cloudRoutine Apr 16, 2017
7301c45
ignore test until FCS supports escaped char colorization
cloudRoutine Apr 16, 2017
e0f0df8
remove commented code, formatting
cloudRoutine Apr 16, 2017
33d8c46
fix cli build
cloudRoutine Apr 16, 2017
dfd2e28
simplify build.fsx
cloudRoutine Apr 16, 2017
e5761c4
fix test xml doc generation
cloudRoutine Apr 16, 2017
e7ca53f
temporarily use custom script host
cloudRoutine Apr 16, 2017
53ccadc
ignore lib dir unless forcibly checked in
cloudRoutine Apr 17, 2017
a144f6d
update test project layout
cloudRoutine Apr 17, 2017
c32937a
update FsUnit api usage
cloudRoutine Apr 17, 2017
e84a823
error handling for assembly loading
cloudRoutine Apr 17, 2017
a6ed59e
unify tests output dir
cloudRoutine Apr 17, 2017
fb09ad0
report loaded assemblies on metadata test failure
cloudRoutine Apr 17, 2017
18d2f3e
update target frameworks
cloudRoutine Apr 17, 2017
4993b17
unify test output into 'tests\bin'
cloudRoutine Apr 17, 2017
f4de496
fix pathing in metadata tests
cloudRoutine Apr 17, 2017
3fe0c85
paket magic mode
cloudRoutine Apr 17, 2017
54e4663
update packages
cloudRoutine Apr 17, 2017
4c31049
update redirects, fix some references files
cloudRoutine Apr 17, 2017
89b9091
add magic mode paket.exe (bootstrapper)
cloudRoutine Apr 17, 2017
34737f4
fix build script error and add app.config to MetadataFormat.Tests
matthid Apr 17, 2017
0698e48
ensure dir
matthid Apr 17, 2017
042f949
fix pattern
matthid Apr 17, 2017
b443c8e
set newline to lf in editorconfig
cloudRoutine Apr 17, 2017
4fbf4f7
fix metadata tests
cloudRoutine Apr 17, 2017
58bb4d6
yield keyword tokens while parsing ident islands
cloudRoutine Apr 17, 2017
d4ce827
match xml doc files case insensitive
cloudRoutine Apr 17, 2017
ac6ab34
fix build
matthid Apr 23, 2017
f610e5f
trigger build
matthid Apr 23, 2017
1eb309a
Merge pull request #432 from cloudRoutine/fcs-only
matthid Apr 23, 2017
0d24f1d
step 1 update fake
matthid Apr 24, 2017
084275d
Merge remote-tracking branch 'origin/master' into netcore_support
matthid Apr 24, 2017
5b9e015
appveyor
matthid Apr 24, 2017
36e8eaf
maybe with vs2017?
matthid Apr 24, 2017
82e317b
fix windows/appveyor build
matthid Apr 24, 2017
ac4ef9a
add more logs
matthid Apr 24, 2017
694d52f
trigger appveyor
matthid Apr 25, 2017
6382e32
trigger appveyor
matthid Apr 25, 2017
b5e7692
make logging verbose
matthid Apr 25, 2017
9c40a9f
log project options
matthid Apr 25, 2017
6bf6366
add fscore to argument list
matthid Apr 25, 2017
6637d38
fix test build
matthid Apr 25, 2017
e0b797b
do stuff ourself
matthid Apr 25, 2017
6721f6f
?
matthid Apr 25, 2017
a0594a9
UseScriptResolutionRules
matthid Apr 25, 2017
4d35c84
fix logging
matthid Apr 25, 2017
f2a81d1
try something else..
matthid Apr 25, 2017
de6087c
add logging to tests
matthid Apr 27, 2017
e2b77f4
save testresults?
matthid Apr 27, 2017
7e6aa64
please appyevor
matthid Apr 28, 2017
3cc13fb
enable verbose logging
matthid Apr 28, 2017
76d0263
logging...
matthid Apr 28, 2017
32ebb7d
fix warnings?
matthid Apr 28, 2017
d721c0a
Merge pull request #435 from matthid/netcore_support
matthid Apr 28, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# top-most EditorConfig file
root = true

[*]
end_of_line = lf

[*.{fs,fsi,fsx}]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.fake/
.vs/
bin/
lib/
obj/
/.paket/paket.exe
paket-files/
nuget/*.nupkg
docs/output/
Expand All @@ -19,7 +21,6 @@ misc/literate/output/content/
*.sln.DotSettings.user
*.userprefs
*.bak
.paket/paket.exe
release.cmd
*.orig
*.aux
Expand All @@ -28,3 +29,7 @@ release.cmd
*.synctex
*.log
*.svclog

.paket/paket.exe
fsbuild.targets
*.sln.tddstud10.user
Binary file removed .paket/paket.bootstrapper.exe
Binary file not shown.
Binary file added .paket/paket.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions .paket/paket.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Prerelease" value="True"/>
</appSettings>
</configuration>
62 changes: 43 additions & 19 deletions .paket/paket.targets
Original file line number Diff line number Diff line change
@@ -1,38 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Download Paket.exe if it does not already exist -->
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
</PropertyGroup>

<PropertyGroup>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>
<!-- Commands -->
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
</PropertyGroup>

<Choose> <!-- MyProject.fsproj.paket.references has the highest precedence -->
<When Condition="Exists('$(MSBuildProjectFullPath).paket.references')">
<PropertyGroup>
<PaketReferences>$(MSBuildProjectFullPath).paket.references</PaketReferences>
</PropertyGroup>
</When> <!-- MyProject.paket.references -->
<When Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references')">
<PropertyGroup>
<PaketReferences>$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketReferences>
</PropertyGroup>
</When> <!-- paket.references -->
<When Condition="Exists('$(MSBuildProjectDirectory)\paket.references')">
<PropertyGroup>
<PaketReferences>$(MSBuildProjectDirectory)\paket.references</PaketReferences>
</PropertyGroup>
</When> <!-- Set to empty if a reference file isn't found matching one of the 3 format options -->
<Otherwise>
<PropertyGroup>
<PaketReferences></PaketReferences>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<!-- Commands -->
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketReferences>
<PaketReferences Condition="!Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
<PaketReferences Condition="!Exists('$(PaketReferences)')">$(MSBuildStartupDirectory)\paket.references</PaketReferences>
<PaketReferences Condition="Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectFullPath).paket.references</PaketReferences>
<RestoreCommand>$(PaketCommand) restore --references-files "$(PaketReferences)"</RestoreCommand>
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate paket.exe -->
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
</Target>
<Target Name="DownloadPaket">
<Exec Command="$(DownloadPaketCommand)" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)" WorkingDirectory="$(PaketRootPath)" Condition="Exists('$(PaketReferences)')" />
<Target Name="RestorePackages">
<Exec Command="$(RestoreCommand)"
IgnoreStandardErrorWarningFormat="true"
WorkingDirectory="$(PaketRootPath)"
ContinueOnError="true"
Condition=" Exists('$(PaketReferences)') AND '$(PaketReferences)' != '' "
/>
</Target>
</Project>
41 changes: 41 additions & 0 deletions FSharp.Formatting.TestHelpers/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
namespace FSharp.Formatting.AssemblyInfo

open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("FSharp.Formatting.TestHelpers")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("FSharp.Formatting.TestHelpers")>]
[<assembly: AssemblyCopyright("Copyright © 2017")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("0b552f94-33fe-4037-9c17-1eb2a885f263")>]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]

do
()
86 changes: 86 additions & 0 deletions FSharp.Formatting.TestHelpers/FSharp.Formatting.TestHelpers.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>0b552f94-33fe-4037-9c17-1eb2a885f263</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>FSharp.Formatting.TestHelpers</RootNamespace>
<AssemblyName>FSharp.Formatting.TestHelpers</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.4.1.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>FSharp.Formatting.TestHelpers</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="TestHelpers.fs" />
<None Include="Script.fsx" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core">
<Name>FSharp.Core</Name>
<AssemblyName>FSharp.Core.dll</AssemblyName>
<HintPath>$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<HintPath>..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\FSharp.Formatting.Common\FSharp.Formatting.Common.fsproj">
<Name>FSharp.Formatting.Common</Name>
<Project>{91bad90e-bf3b-4646-a1a7-1568f8f25075}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
8 changes: 8 additions & 0 deletions FSharp.Formatting.TestHelpers/Script.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Learn more about F# at http://fsharp.org. See the 'F# Tutorial' project
// for more guidance on F# programming.

#load "Library1.fs"
open FSharp.Formatting.TestHelpers

// Define your library scripting code here

41 changes: 41 additions & 0 deletions FSharp.Formatting.TestHelpers/TestHelpers.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module FSharp.Formatting.TestHelpers

open System.Diagnostics
open FSharp.Formatting
module Logging = FSharp.Formatting.Common.Log

// This controlls logging within the test suite ...
let enableLogging() =
let logToConsole = true
let logToFile = false
try
let allTraceOptions =
TraceOptions.Callstack ||| TraceOptions.DateTime ||| TraceOptions.LogicalOperationStack |||
TraceOptions.ProcessId ||| TraceOptions.ThreadId ||| TraceOptions.Timestamp
let noTraceOptions = TraceOptions.None
let svclogFile = "FSharp.Formatting.svclog"
System.Diagnostics.Trace.AutoFlush <- true

let setupListener listener =
[ FSharp.Formatting.Common.Log.source
Yaaf.FSharp.Scripting.Log.source ]
|> Seq.iter (fun source ->
source.Switch.Level <- System.Diagnostics.SourceLevels.All
Logging.AddListener listener source)

if logToConsole then
Logging.ConsoleListener()
|> Logging.SetupListener noTraceOptions System.Diagnostics.SourceLevels.Verbose
|> setupListener

if logToFile then
if System.IO.File.Exists svclogFile then System.IO.File.Delete svclogFile
Logging.SvclogListener svclogFile
|> Logging.SetupListener allTraceOptions System.Diagnostics.SourceLevels.All
|> setupListener

// Test that everything works
Logging.infof "FSharp.Formatting Logging setup!"
Yaaf.FSharp.Scripting.Log.infof "Yaaf.FSharp.Scripting Logging setup!"
with e ->
printfn "FSharp.Formatting Logging setup failed: %A" e
4 changes: 4 additions & 0 deletions FSharp.Formatting.TestHelpers/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.3.0" targetFramework="net461" />
</packages>
10 changes: 0 additions & 10 deletions FSharp.Formatting.nunit

This file was deleted.

Loading