Skip to content

Commit

Permalink
Only run these test on 6.0+ toolchain
Browse files Browse the repository at this point in the history
CodeLLDB is not working with older toolchains so need to use lldb-dap
  • Loading branch information
award999 committed Oct 9, 2024
1 parent 639ab3a commit 34ed2dd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
37 changes: 17 additions & 20 deletions src/SwiftSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,21 @@ export async function debugSnippetWithOptions(
ctx.toolchain
);

try {
// queue build task and when it is complete run executable in the debugger
await folderContext.taskQueue
.queueOperation(new TaskOperation(snippetBuildTask))
.then(result => {
if (result === 0) {
const snippetDebugConfig = createSnippetConfiguration(
snippetName,
folderContext
);
return debugLaunchConfig(
folderContext.workspaceFolder,
snippetDebugConfig,
options
);
}
});
} catch {
// ignore error if task failed to run
}
// try {
// queue build task and when it is complete run executable in the debugger
await folderContext.taskQueue
.queueOperation(new TaskOperation(snippetBuildTask))
.then(result => {
if (result === 0) {
const snippetDebugConfig = createSnippetConfiguration(snippetName, folderContext);
return debugLaunchConfig(
folderContext.workspaceFolder,
snippetDebugConfig,
options
);
}
});
// } catch {
// // ignore error if task failed to run
// }
}
8 changes: 6 additions & 2 deletions test/integration-tests/SwiftSnippet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ import {
waitForDebugAdapterExit,
waitUntilDebugSessionTerminates,
} from "../utilities/debug";
import { Version } from "../../src/utilities/version";

suite("SwiftSnippet Test Suite", () => {
const uri = testAssetUri("defaultPackage/Snippets/hello.swift");
const breakpoints = [
new vscode.SourceBreakpoint(new vscode.Location(uri, new vscode.Position(2, 0))),
];

suiteSetup(async () => {
await folderContextPromise("defaultPackage");
suiteSetup(async function () {
const folder = await folderContextPromise("defaultPackage");
if (folder.workspaceContext.toolchain.swiftVersion.isLessThan(new Version(6, 0, 0))) {
this.skip();
}
await waitForNoRunningTasks();

// File needs to be open for command to be enabled
Expand Down

0 comments on commit 34ed2dd

Please sign in to comment.