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
13 changes: 12 additions & 1 deletion tests/Beam/Fable.Tests.Beam.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Fable's project cracking runs CoreCompile with FABLE_COMPILER set, which would pull in
xunit.v3's generated entry point and runner reporters: .NET-only sources that break
transpilation. Disable them for the Fable build; the real .NET build keeps them. -->
<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 +15,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 All @@ -22,6 +27,12 @@
<ItemGroup>
<ProjectReference Include="../../src/Fable.Core/Fable.Core.fsproj" />
</ItemGroup>
<ItemGroup>
<!-- Run xunit serially: some MailboxProcessor/async tests assert from fire-and-forget
`Async.StartImmediate` continuations that can outlive their test collection, and
xunit.v3 reports such background exceptions as catastrophic (v2 ignored them). -->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Compile Include="Misc/Aether.fs" />
<Compile Include="Misc/Imports.fs" />
Expand Down
6 changes: 2 additions & 4 deletions tests/Beam/Main.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#if FABLE_COMPILER
module Program
// No entry point: Fable does not need one here, and on .NET xunit.v3
// generates the test runner entry point.
()
#else
module Program = let [<EntryPoint>] main _ = 0
#endif
5 changes: 5 additions & 0 deletions tests/Beam/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
}
14 changes: 13 additions & 1 deletion tests/Php/Fable.Tests.Php.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Fable's project cracking runs CoreCompile with FABLE_COMPILER set, which would pull in
xunit.v3's generated entry point and runner reporters: .NET-only sources that break
transpilation. Disable them for the Fable build; the real .NET build keeps them. -->
<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 +14,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 All @@ -17,6 +23,12 @@
<ItemGroup>
<ProjectReference Include="../../src/Fable.Core/Fable.Core.fsproj" />
</ItemGroup>
<ItemGroup>
<!-- Run xunit serially: some async tests assert from fire-and-forget
`Async.StartImmediate` continuations that can outlive their test collection, and
xunit.v3 reports such background exceptions as catastrophic (v2 ignored them). -->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Compile Include="Util.fs" />
<Compile Include="TestSeq.fs" />
Expand Down
6 changes: 2 additions & 4 deletions tests/Php/Main.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#if FABLE_COMPILER
module Program
// No entry point: Fable does not need one here, and on .NET xunit.v3
// generates the test runner entry point.
()
#else
module Program = let [<EntryPoint>] main _ = 0
#endif
5 changes: 5 additions & 0 deletions tests/Php/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
}
13 changes: 12 additions & 1 deletion tests/Python/Fable.Tests.Python.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Fable's project cracking runs CoreCompile with FABLE_COMPILER set, which would pull in
xunit.v3's generated entry point and runner reporters: .NET-only sources that break
transpilation. Disable them for the Fable build; the real .NET build keeps them. -->
<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 +15,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 +27,12 @@
<ItemGroup>
<ProjectReference Include="../../src/Fable.Core/Fable.Core.fsproj" />
</ItemGroup>
<ItemGroup>
<!-- Run xunit serially: some MailboxProcessor/async tests assert from fire-and-forget
`Async.StartImmediate` continuations that can outlive their test collection, and
xunit.v3 reports such background exceptions as catastrophic (v2 ignored them). -->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Compile Include="../Js/Main/Globs/*.fs" />
<Compile Include="Util.fs" />
Expand Down
6 changes: 2 additions & 4 deletions tests/Python/Main.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#if FABLE_COMPILER
module Program
// No entry point: Fable does not need one here, and on .NET xunit.v3
// generates the test runner entry point.
()
#else
module Program = let [<EntryPoint>] main _ = 0
#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
}
9 changes: 8 additions & 1 deletion tests/Rust/Fable.Tests.Rust.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Fable's project cracking runs CoreCompile with FABLE_COMPILER set, which would append
xunit.v3's generated entry point and runner reporters after tests/src/main.fs, breaking
transpilation (the entry point must be the last declaration, and those sources are
.NET-only). Disable them for the Fable build; the real .NET build keeps them. -->
<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 +15,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