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
7 changes: 5 additions & 2 deletions src/Fable.Transforms/Rust/Fable2Rust.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6480,12 +6480,16 @@ module Compiler =
ModuleDepth = 0
}

let entryPointItems = file.Declarations |> getEntryPointItems com ctx

let topAttrs =
[
if isLastFileInProject com then
// adds "no_std" to crate if feature is enabled
mkInnerAttr "cfg_attr" [ "feature = \"no_std\""; "no_std" ]
mkInnerAttr "cfg_attr" [ "feature = \"no_std\""; "no_main" ]
// Libraries retain Cargo's test-harness entry point.
if not (List.isEmpty entryPointItems) then
mkInnerAttr "cfg_attr" [ "feature = \"no_std\""; "no_main" ]

// TODO: make some of those conditional on compiler options
mkInnerAttr "allow" [ "dead_code" ]
Expand All @@ -6507,7 +6511,6 @@ module Compiler =
// mkInnerAttr "feature" ["destructuring_assignment"]
]

let entryPointItems = file.Declarations |> getEntryPointItems com ctx
let importItems = com.GetAllImports(ctx) |> transformImports com ctx
let declItems = file.Declarations |> transformDeclarations com ctx
let modItems = getModuleItems com ctx // global module imports
Expand Down
14 changes: 11 additions & 3 deletions tests/Beam/Fable.Tests.Beam.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Exclude .NET-only xUnit runner sources during Fable project cracking. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<XunitRegisterBuiltInResultWriters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInResultWriters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -10,8 +14,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<!-- Keep the existing VSTest-based dotnet test commands on .NET 10. -->
<PackageReference Include="xunit.v3.mtp-off" Version="4.0.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -24,6 +29,10 @@
<ProjectReference Include="../../src/Fable.Core/Fable.Core.fsproj" />
<ProjectReference Include="MemberNameCollisionLibrary/MemberNameCollisionLibrary.fsproj" />
</ItemGroup>
<ItemGroup>
<!-- Temporary CI workaround for detached async assertions; remove once .NET tests await completion. -->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Compile Include="Misc/Aether.fs" />
<Compile Include="Misc/Imports.fs" />
Expand Down Expand Up @@ -104,6 +113,5 @@
<Compile Include="ModuleMutableTwoTests.fs" />
<Compile Include="ModuleNamingTests.fs" />
<Compile Include="MemberNamingTests.fs" />
<Compile Include="Main.fs" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions tests/Beam/Main.fs

This file was deleted.

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
}
10 changes: 7 additions & 3 deletions tests/Php/Fable.Tests.Php.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Exclude .NET-only xUnit runner sources during Fable project cracking. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<XunitRegisterBuiltInResultWriters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInResultWriters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -9,8 +13,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<!-- Keep the existing VSTest-based dotnet test commands on .NET 10. -->
<PackageReference Include="xunit.v3.mtp-off" Version="4.0.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -31,7 +36,6 @@
<Compile Include="TestUnionType.fs" />
<Compile Include="TestLoops.fs" />
<Compile Include="TestAsync.fs" />
<Compile Include="Main.fs" />

</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions tests/Php/Main.fs

This file was deleted.

14 changes: 11 additions & 3 deletions tests/Python/Fable.Tests.Python.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Exclude .NET-only xUnit runner sources during Fable project cracking. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<XunitRegisterBuiltInResultWriters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInResultWriters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -10,8 +14,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.0">
<!-- Keep the existing VSTest-based dotnet test commands on .NET 10. -->
<PackageReference Include="xunit.v3.mtp-off" Version="4.0.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -22,6 +27,10 @@
<ItemGroup>
<ProjectReference Include="../../src/Fable.Core/Fable.Core.fsproj" />
</ItemGroup>
<ItemGroup>
<!-- Temporary Windows CI workaround; remove once .NET async tests await completion. -->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Compile Include="../Js/Main/Globs/*.fs" />
<Compile Include="Util.fs" />
Expand Down Expand Up @@ -88,6 +97,5 @@
<Compile Include="TestNonRegression.fs" />
<Compile Include="TestQuotation.fs" />
<Compile Include="TestInlineIfLambda.fs" />
<Compile Include="Main.fs" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions tests/Python/Main.fs

This file was deleted.

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
}
10 changes: 8 additions & 2 deletions tests/Rust/Fable.Tests.Rust.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Exclude .NET-only xUnit runner sources during Fable project cracking. -->
<XunitAutoGeneratedEntryPoint Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitAutoGeneratedEntryPoint>
<XunitRegisterBuiltInRunnerReporters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInRunnerReporters>
<XunitRegisterBuiltInResultWriters Condition="'$(FABLE_COMPILER)' == 'True'">false</XunitRegisterBuiltInResultWriters>
<TargetFramework>net10.0</TargetFramework>
<RollForward>Major</RollForward>
<IsPackable>false</IsPackable>
Expand All @@ -8,8 +13,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageReference Include="XUnit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.0">
<!-- Keep the existing VSTest-based dotnet test commands on .NET 10. -->
<PackageReference Include="xunit.v3.mtp-off" Version="4.0.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 0 additions & 4 deletions tests/Rust/tests/src/lib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ open Fable.Core.Rust
let _imports() =
importAll "./ExtInteropTests.rs"
()

// Comment the main func when no longer needed (after migrating to xunit v3)
[<EntryPoint>]
let main _args = 0
Loading