From 9946d1814f4af9ef67e5accd9404e0fc69290f6f Mon Sep 17 00:00:00 2001 From: JassJam <0139ne@gmail.com> Date: Mon, 23 Feb 2026 12:28:50 +0000 Subject: feat: add initial test files --- .../csharp/console_with_runtime_json/src/Program.cs | 17 +++++++++++++++++ .../csharp/console_with_runtime_json/src/app.csproj | 14 ++++++++++++++ .../csharp/console_with_runtime_json/src/runtime.json | 7 +++++++ 3 files changed, 38 insertions(+) create mode 100644 tests/projects/csharp/console_with_runtime_json/src/Program.cs create mode 100644 tests/projects/csharp/console_with_runtime_json/src/app.csproj create mode 100644 tests/projects/csharp/console_with_runtime_json/src/runtime.json (limited to 'tests/projects/csharp/console_with_runtime_json/src') diff --git a/tests/projects/csharp/console_with_runtime_json/src/Program.cs b/tests/projects/csharp/console_with_runtime_json/src/Program.cs new file mode 100644 index 000000000..2c9b0783b --- /dev/null +++ b/tests/projects/csharp/console_with_runtime_json/src/Program.cs @@ -0,0 +1,17 @@ +using System.Text.Json; + +var runtimeFile = Path.Combine(AppContext.BaseDirectory, "runtime.json"); +if (!File.Exists(runtimeFile)) +{ + Console.WriteLine("runtime.json missing"); + return; +} + +var json = File.ReadAllText(runtimeFile); +using var doc = JsonDocument.Parse(json); +var runtime = doc.RootElement.TryGetProperty("runtime", out var value) + ? value.GetString() + : "unknown"; + +Console.WriteLine($"runtime={runtime}"); + diff --git a/tests/projects/csharp/console_with_runtime_json/src/app.csproj b/tests/projects/csharp/console_with_runtime_json/src/app.csproj new file mode 100644 index 000000000..4e754bb15 --- /dev/null +++ b/tests/projects/csharp/console_with_runtime_json/src/app.csproj @@ -0,0 +1,14 @@ + + + Exe + net8.0 + enable + enable + + + + PreserveNewest + + + + diff --git a/tests/projects/csharp/console_with_runtime_json/src/runtime.json b/tests/projects/csharp/console_with_runtime_json/src/runtime.json new file mode 100644 index 000000000..15bec810d --- /dev/null +++ b/tests/projects/csharp/console_with_runtime_json/src/runtime.json @@ -0,0 +1,7 @@ +{ + "runtime": "xmake", + "featureFlags": { + "sample": true + } +} + -- cgit v1.3.1