Skip to content

Commit

Permalink
Pass environment to the testing debugger
Browse files Browse the repository at this point in the history
The C++ debugger requires "environment" key.
https://code.visualstudio.com/docs/cpp/launch-json-reference

Fixes #240
  • Loading branch information
cskeogh committed Jun 17, 2024
1 parent 3f4ee1e commit 664a05b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,20 @@ export async function testDebugHandler(
let args = [...test.cmd];
args.shift();

const debugEnv = [];
/* convert from dict of key = value to array of {name: key, value: value} */
if (test.env instanceof Object) {
for (const [key, val] of Object.entries(test.env)) {
debugEnv.push({ name: key, value: val });
}
}

let debugConfiguration = {
name: `meson-debug-${test.name}`,
type: debugType,
request: "launch",
cwd: test.workdir || sourceDir,
env: test.env,
environment: debugEnv,
program: test.cmd[0],
args: args,
};
Expand Down

0 comments on commit 664a05b

Please sign in to comment.