Skip to content

Commit db5d507

Browse files
committed
Set env var to preserve test case encoding w/ swift testing
swiftlang/swift-testing#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.
1 parent 919b8ba commit db5d507

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/debugger/buildConfig.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ export class TestingConfigurationFactory {
334334
const libraryPath = toolchain.swiftTestingLibraryPath();
335335
const frameworkPath = toolchain.swiftTestingFrameworkPath();
336336
const swiftPMTestingHelperPath = toolchain.swiftPMTestingHelperPath;
337+
const env = {
338+
...this.testEnv,
339+
...this.sanitizerRuntimeEnvironment,
340+
DYLD_FRAMEWORK_PATH: frameworkPath,
341+
DYLD_LIBRARY_PATH: libraryPath,
342+
SWT_SF_SYMBOLS_ENABLED: "0",
343+
SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING: "1",
344+
};
337345

338346
// Toolchains that contain https://github.com/swiftlang/swift-package-manager/commit/844bd137070dcd18d0f46dd95885ef7907ea0697
339347
// produce a single testing binary for both xctest and swift-testing (called <ProductName>.xctest).
@@ -354,13 +362,7 @@ export class TestingConfigurationFactory {
354362
])
355363
)
356364
),
357-
env: {
358-
...this.testEnv,
359-
...this.sanitizerRuntimeEnvironment,
360-
DYLD_FRAMEWORK_PATH: frameworkPath,
361-
DYLD_LIBRARY_PATH: libraryPath,
362-
SWT_SF_SYMBOLS_ENABLED: "0",
363-
},
365+
env,
364366
};
365367
return result;
366368
}
@@ -369,13 +371,7 @@ export class TestingConfigurationFactory {
369371
...baseConfig,
370372
program: await this.testExecutableOutputPath(),
371373
args: this.debuggingTestExecutableArgs(),
372-
env: {
373-
...this.testEnv,
374-
...this.sanitizerRuntimeEnvironment,
375-
DYLD_FRAMEWORK_PATH: frameworkPath,
376-
DYLD_LIBRARY_PATH: libraryPath,
377-
SWT_SF_SYMBOLS_ENABLED: "0",
378-
},
374+
env,
379375
};
380376
return result;
381377
default:
@@ -398,6 +394,7 @@ export class TestingConfigurationFactory {
398394
...this.testEnv,
399395
...this.sanitizerRuntimeEnvironment,
400396
SWT_SF_SYMBOLS_ENABLED: "0",
397+
SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING: "1",
401398
},
402399
// For coverage we need to rebuild so do the build/test all in one step,
403400
// otherwise we do a build, then test, to give better progress.

0 commit comments

Comments
 (0)