From 735a75cbd391302a9eb1e741acc6aaecaa848fb1 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Wed, 19 Mar 2025 16:29:48 -0700 Subject: [PATCH] Don't overwrite the WitBindgenAddtionalArgs In addtion this adds a test that runs outside the the test framework with didn't catch this due the way the properties are imported Signed-off-by: James Sturtevant --- .../BytecodeAlliance.Componentize.DotNet.WitBindgen.targets | 1 - test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj | 1 + test/E2ETest/testapps/E2EConsumer/Program.cs | 5 +++++ test/E2ETest/testapps/E2EProducer/E2EProducer.csproj | 1 + test/E2ETest/testapps/E2EProducer/OperationsImpl.cs | 5 +++++ test/E2ETest/testapps/E2EProducer/producer-consumer.wit | 4 +++- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets b/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets index 0175fe5..844cad2 100644 --- a/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets +++ b/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets @@ -1,7 +1,6 @@  native-aot - 24.0 diff --git a/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj b/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj index 8582dd3..aca4445 100644 --- a/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj +++ b/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj @@ -14,6 +14,7 @@ false true e2econsumer + --features float-add diff --git a/test/E2ETest/testapps/E2EConsumer/Program.cs b/test/E2ETest/testapps/E2EConsumer/Program.cs index db95c0d..6c1943c 100644 --- a/test/E2ETest/testapps/E2EConsumer/Program.cs +++ b/test/E2ETest/testapps/E2EConsumer/Program.cs @@ -5,3 +5,8 @@ var result = OperationsInterop.Add(123, 456); Console.WriteLine($"123 + 456 = {result}"); + +// this is just here to make sure we can enable features and pass flags via WitBindgenAddtionalArgs +// the fact that it compiles is enough to test this worked. +var floatResult = OperationsInterop.AddFloat(1.1f, 1.2f); +Console.WriteLine($"1.1 + 1.2 = {floatResult}"); diff --git a/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj b/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj index 02ac3d8..425b924 100644 --- a/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj +++ b/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj @@ -12,6 +12,7 @@ wasi-wasm true e2eproducer + --features float-add diff --git a/test/E2ETest/testapps/E2EProducer/OperationsImpl.cs b/test/E2ETest/testapps/E2EProducer/OperationsImpl.cs index 2b65805..7ce279a 100644 --- a/test/E2ETest/testapps/E2EProducer/OperationsImpl.cs +++ b/test/E2ETest/testapps/E2EProducer/OperationsImpl.cs @@ -6,4 +6,9 @@ public static int Add(int left, int right) { return left + right; } + + public static float AddFloat(float left, float right) + { + return left + right; + } } diff --git a/test/E2ETest/testapps/E2EProducer/producer-consumer.wit b/test/E2ETest/testapps/E2EProducer/producer-consumer.wit index 9215fa1..65b2bd0 100644 --- a/test/E2ETest/testapps/E2EProducer/producer-consumer.wit +++ b/test/E2ETest/testapps/E2EProducer/producer-consumer.wit @@ -1,7 +1,9 @@ package test:producer-consumer; interface operations { - add: func(left: s32, right: s32) -> s32; + add: func(left: s32, right: s32) -> s32; + @unstable(feature = float-add) + add-float: func(a: f32, b: f32) -> f32; } world producer {