DavidSchuldenfrei/gtest-adapter

cwd from launch.json not respected when listing the tests

Opened this issue · 0 comments

When the adapter lists the tests in the "Google Tests" panel, it does not actually respect the working directory, cwd, from launch.json. This leads to problems with e.g. locating dynamically linked libraries, which on the other hand makes the listing fail.

The bug seems to be in GTestWrapper.ts / loadTestLines, which ignores the cwd config parameter when executing the test executable with child_process.execSync:
private loadTestLines(config: TestConfig, filename: string): Thenable<string[]> { ... var results = execSync('"' + config.program + '"' + ' --gtest_list_tests --gtest_output=json:' + filename, { encoding: "utf8", env: config.env }) ...


OS: Windows 10.0.17763
VS Code: 1.39.2
gtest-adapter: 1.8.3 from VSCode Market Place