Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 1.0.10

### added

* documentation examples

### changed

* moved to xunit.v3

## 1.0.9

* changed global and target framework to net10
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The source file can contain directives to reference libraries and to influence t

Because of a) concerns of parts of the F# community about having two similar tools (`dotnet fsi script.fsx` and `dotnet runfs app.fs`) and b) missing "market pull", I have currently no further plans for this project.

The tool is still available as dotnet tool and can be useful especially for ad-hoc testing of library projects.
The tool is still available as dotnet tool and can be useful especially for [ad-hoc testing of library projects](docs/examples/testing/README.md).

## Usage

Expand Down
10 changes: 10 additions & 0 deletions docs/examples/testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Using runfs for library testing

## Explorative testing

Just create an ad-hoc driver file (see example file `explore.fs` in this directory), add a project reference and start testing your library API by running `dotnet runfs explore.fs`.

## Unit test development / fixes

Rather than building a test project, discovering the tests, selecting the one you are interested in and running it, you just add the project reference and the test framework package reference to the test file you are interested in (see example file `tests.fs`, using xunit.v3) and run it with runfs (here: `dotnet runfs tests.fs`).

5 changes: 5 additions & 0 deletions docs/examples/testing/explore.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#r_project "D:/fsharp/projects/div/Runfs/docs/examples/testing/mylib/mylib.fsproj"

open Mylib

printfn $"Hello {x}"
5 changes: 5 additions & 0 deletions docs/examples/testing/mylib/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions docs/examples/testing/mylib/Library.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Mylib

let x = 42
11 changes: 11 additions & 0 deletions docs/examples/testing/mylib/mylib.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Library.fs" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions docs/examples/testing/tests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Mylib.Tests

#r_package "xunit.v3.mtp-v2@3.2.2"
#r_project "mylib/mylib.fsproj"

#nowarn 988

open Xunit
open Mylib

[<Fact>]
let test1 () =
Assert.Equal(x, 42)
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"version": "10.0.100",
"rollForward": "latestMinor",
"allowPrerelease": false
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
}
11 changes: 7 additions & 4 deletions src/Runfs/Runfs.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<!-- General -->
<AssemblyName>Runfs</AssemblyName>
<Version>1.0.9</Version>
<Version>1.0.10</Version>
<Description>"dotnet run app.cs" functionality for F#.</Description>
<Copyright>Copyright 2025 by Martin521</Copyright>
<Authors>Martin521 and contributors</Authors>
Expand All @@ -15,12 +15,15 @@
<PackAsTool>True</PackAsTool>
<ToolCommandName>runfs</ToolCommandName>
<PackageReleaseNotes>
## 1.0.9
## 1.0.10

### added

* documentation examples

### changed

* changed global and target framework to net10
* updated README
* moved to xunit.v3
</PackageReleaseNotes>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageIcon>
Expand Down
13 changes: 2 additions & 11 deletions tests/Runfs.Tests/Runfs.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<Compile Include="DirectivesTests.fs" />
<Compile Include="ScriptTests.fs" />
</ItemGroup>
<ItemGroup>
<Content Include="TestFiles/*" CopyToOutputDirectory="PreserveNewest" />
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="17.14.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Runfs\Runfs.fsproj" />
Expand Down