From db5d50710262241416124f84772fb4e349f54ab8 Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Wed, 27 Aug 2025 08:56:38 -0400 Subject: [PATCH 1/2] Set env var to preserve test case encoding w/ swift testing https://github.com/swiftlang/swift-testing/pull/1287 gates the `_testCase` field behind the experimental version number check, which will be tied to the swift version of the client, supplied by vs code. Set the `SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING` flag to allow any version of swift-testing to continue to work with the extension. --- src/debugger/buildConfig.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/debugger/buildConfig.ts b/src/debugger/buildConfig.ts index 738f5d00f..dbbc05406 100644 --- a/src/debugger/buildConfig.ts +++ b/src/debugger/buildConfig.ts @@ -334,6 +334,14 @@ export class TestingConfigurationFactory { const libraryPath = toolchain.swiftTestingLibraryPath(); const frameworkPath = toolchain.swiftTestingFrameworkPath(); const swiftPMTestingHelperPath = toolchain.swiftPMTestingHelperPath; + const env = { + ...this.testEnv, + ...this.sanitizerRuntimeEnvironment, + DYLD_FRAMEWORK_PATH: frameworkPath, + DYLD_LIBRARY_PATH: libraryPath, + SWT_SF_SYMBOLS_ENABLED: "0", + SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING: "1", + }; // Toolchains that contain https://github.com/swiftlang/swift-package-manager/commit/844bd137070dcd18d0f46dd95885ef7907ea0697 // produce a single testing binary for both xctest and swift-testing (called .xctest). @@ -354,13 +362,7 @@ export class TestingConfigurationFactory { ]) ) ), - env: { - ...this.testEnv, - ...this.sanitizerRuntimeEnvironment, - DYLD_FRAMEWORK_PATH: frameworkPath, - DYLD_LIBRARY_PATH: libraryPath, - SWT_SF_SYMBOLS_ENABLED: "0", - }, + env, }; return result; } @@ -369,13 +371,7 @@ export class TestingConfigurationFactory { ...baseConfig, program: await this.testExecutableOutputPath(), args: this.debuggingTestExecutableArgs(), - env: { - ...this.testEnv, - ...this.sanitizerRuntimeEnvironment, - DYLD_FRAMEWORK_PATH: frameworkPath, - DYLD_LIBRARY_PATH: libraryPath, - SWT_SF_SYMBOLS_ENABLED: "0", - }, + env, }; return result; default: @@ -398,6 +394,7 @@ export class TestingConfigurationFactory { ...this.testEnv, ...this.sanitizerRuntimeEnvironment, SWT_SF_SYMBOLS_ENABLED: "0", + SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING: "1", }, // For coverage we need to rebuild so do the build/test all in one step, // otherwise we do a build, then test, to give better progress. From e3bd70cadb69a29cdd18f73e18e92572bd01b085 Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Wed, 27 Aug 2025 15:36:30 -0400 Subject: [PATCH 2/2] Rename variable --- src/debugger/buildConfig.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debugger/buildConfig.ts b/src/debugger/buildConfig.ts index dbbc05406..d94a076d4 100644 --- a/src/debugger/buildConfig.ts +++ b/src/debugger/buildConfig.ts @@ -340,7 +340,7 @@ export class TestingConfigurationFactory { DYLD_FRAMEWORK_PATH: frameworkPath, DYLD_LIBRARY_PATH: libraryPath, SWT_SF_SYMBOLS_ENABLED: "0", - SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING: "1", + SWT_EXPERIMENTAL_EVENT_STREAM_FIELDS_ENABLED: "1", }; // Toolchains that contain https://github.com/swiftlang/swift-package-manager/commit/844bd137070dcd18d0f46dd95885ef7907ea0697 @@ -394,7 +394,7 @@ export class TestingConfigurationFactory { ...this.testEnv, ...this.sanitizerRuntimeEnvironment, SWT_SF_SYMBOLS_ENABLED: "0", - SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING: "1", + SWT_EXPERIMENTAL_EVENT_STREAM_FIELDS_ENABLED: "1", }, // For coverage we need to rebuild so do the build/test all in one step, // otherwise we do a build, then test, to give better progress.