Skip to content

Commit 9a99c2e

Browse files
committed
Make named pipe creation more clear
1 parent 3a52e3f commit 9a99c2e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: src/TestExplorer/TestRunner.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ export class TestRunner {
203203
: path.join(os.tmpdir(), `vscodemkfifo-${Date.now()}`);
204204

205205
await TemporaryFolder.withNamedTemporaryFile(fifoPipePath, async () => {
206+
// macOS/Linux require us to create the named pipe before we use it.
207+
// Windows just lets us communicate by specifying a pipe path without any ceremony.
208+
if (process.platform !== "win32") {
209+
await execFile("mkfifo", [fifoPipePath], undefined, this.folderContext);
210+
}
211+
206212
const testBuildConfig =
207213
await LaunchConfigurations.createLaunchConfigurationForSwiftTesting(
208214
this.testArgs.swiftTestArgs,
@@ -736,7 +742,6 @@ class LaunchConfigurations {
736742
const testList = args.join(",");
737743

738744
if (process.platform === "darwin") {
739-
await execFile("mkfifo", [fifoPipePath], undefined, folderContext);
740745
const testBuildConfig = createSwiftTestConfiguration(folderContext, fifoPipePath, true);
741746
if (testBuildConfig === null) {
742747
return null;
@@ -752,10 +757,6 @@ class LaunchConfigurations {
752757

753758
return testBuildConfig;
754759
} else {
755-
if (process.platform !== "win32") {
756-
await execFile("mkfifo", [fifoPipePath], undefined, folderContext);
757-
}
758-
759760
const testBuildConfig = createSwiftTestConfiguration(folderContext, fifoPipePath, true);
760761
if (testBuildConfig === null) {
761762
return null;

0 commit comments

Comments
 (0)