Skip to content
Open
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
9 changes: 8 additions & 1 deletion tests/Beam/Fable.Tests.Beam.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- When Fable cracks the project it defines FABLE_COMPILER and runs CoreCompile,
which makes xunit.v3 attach its generated entry point and runner-reporter
source files. Those reference .NET runtime types and are irrelevant to the
transpiled output, so disable them for the Fable build only; on .NET xunit
still generates the test runner entry point. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -10,7 +17,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 3 additions & 1 deletion tests/Beam/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
module Program
()
#else
module Program = let [<EntryPoint>] main _ = 0
module Program
// On .NET, xunit.v3 generates the test runner entry point automatically.
()
#endif
10 changes: 9 additions & 1 deletion tests/Php/Fable.Tests.Php.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- When Fable cracks the project it defines FABLE_COMPILER and runs CoreCompile,
which makes xunit.v3 attach its generated entry point and runner-reporter
source files. Those reference .NET runtime types and are irrelevant to the
transpiled output, so disable them for the Fable build only; on .NET xunit
still generates the test runner entry point. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -8,7 +16,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 3 additions & 1 deletion tests/Php/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
module Program
()
#else
module Program = let [<EntryPoint>] main _ = 0
module Program
// On .NET, xunit.v3 generates the test runner entry point automatically.
()
#endif
16 changes: 15 additions & 1 deletion tests/Python/Fable.Tests.Python.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- When Fable cracks the project it defines FABLE_COMPILER and runs CoreCompile,
which makes xunit.v3 attach its generated entry point and runner-reporter
source files. Those reference .NET runtime types and are irrelevant to the
transpiled output, so disable them for the Fable build only; on .NET xunit
still generates the test runner entry point. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -10,7 +17,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -22,6 +29,13 @@
<ItemGroup>
<ProjectReference Include="../../src/Fable.Core/Fable.Core.fsproj" />
</ItemGroup>
<ItemGroup>
<!-- Run xunit serially: several MailboxProcessor/async tests assert from a
fire-and-forget `Async.StartImmediate`, whose continuation can run after
its test collection is torn down. xunit.v3 reports such background-thread
exceptions as catastrophic (v2 ignored them), which fails on Windows. -->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Compile Include="../Js/Main/Globs/*.fs" />
<Compile Include="Util.fs" />
Expand Down
4 changes: 3 additions & 1 deletion tests/Python/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
module Program
()
#else
module Program = let [<EntryPoint>] main _ = 0
module Program
// On .NET, xunit.v3 generates the test runner entry point automatically.
()
#endif
5 changes: 5 additions & 0 deletions tests/Python/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"parallelizeTestCollections": false,
"maxParallelThreads": 1
}
11 changes: 10 additions & 1 deletion tests/Rust/Fable.Tests.Rust.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- When Fable cracks the project it defines FABLE_COMPILER and runs CoreCompile,
which makes xunit.v3 attach its generated entry point and runner-reporter
source files after our own files. That breaks transpilation (F# requires the
entry point in tests/src/main.fs to be the last declaration, and those xunit
sources reference runtime types Fable can't transpile). Disable them for the
Fable build only; on .NET xunit still generates the test runner entry point. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -8,7 +17,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 4 additions & 0 deletions tests/Rust/tests/src/main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ let _imports() =
()

// [<OuterAttr("cfg", [|"not(feature = \"no_std\")"|])>]
#if FABLE_COMPILER
// Rust needs a `fn main`, so emit the entry point when transpiling. On .NET,
// xunit.v3 generates the test runner entry point instead (see the .fsproj).
[<EntryPoint>]
let main _args = 0
#endif
Loading