matepek / vscode-catch2-test-adapter

Catch2, Google Test and doctest Adapter for the VSCode
https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter
MIT License
210 stars 52 forks source link

Need to setup environment via script for test detection #334

Closed juxeii closed 2 years ago

juxeii commented 2 years ago

The extension cannot successfully detect google tests, because some GLIBCXX_3.4.26 is not found for all executables. For this to work, I need to call a script which sets up the correct environment. Is there a way to call this script before the extension looks up the executables?

EDIT: Just to add some logging output which illustrates the problem(just snippets of the log)

_[2022-02-23 14:52:05.180] [INFO] Activating extension [2022-02-23 14:52:05.185] [INFO] Activation finished [2022-02-23 14:54:42.686] [INFO] context:executables [ { pattern: '{build,Build,BUILD,out,Out,OUT}/bin/{UT}' } ] [2022-02-23 14:54:42.696] [DEBUG] ExecutableConfig.resolveVariable: { value: '{build,Build,BUILD,out,Out,OUT}/bin/{UT}', resolved: '{build,Build,BUILD,out,Out,OUT}/bin/{UT}', strictAllowed: false } [2022-02-23 14:54:42.697] [INFO] pattern {build,Build,BUILD,out,Out,OUT}/bin/{UT} /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT { isAbsolute: false, absPath: '/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/{build,Build,BUILD,out,Out,OUT}/bin/{UT}', isPartOfWs: true, relativeToWsPosix: '{build,Build,BUILD,out,Out,OUT}/bin/{UT}' } [2022-02-23 14:54:43.053] [DEBUG] Checking file for tests: /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT [2022-02-23 14:54:43.054] [DEBUG] Checking file for tests: /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/rach_config_UT [2022-02-23 14:54:43.067] [DEBUG] ExecutableConfig.resolveVariable: { value: '/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin', resolved: '/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin', strictAllowed: false } [2022-02-23 14:54:43.397] [DEBUG] Not a supported test executable { spawner: s {}, execPath: '/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT', stdout: '', stderr: "/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT)\n" + "/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.26' not found (required by /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT)\n" + "/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT: /lib64/libstdc++.so.6: version CXXABI_1.3.8' not found (required by /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT)\n" + "/var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmt_UT: /lib64/libstdc++.so.6: versionCXXABI_1.3.9' not found (required by /var/fpwork/reiss/gnb/cplane/CP-RT/CP-RT/build/bin/pcmd_mgmtUT)\n" +

So, the correct libs are not there for some operation of the extension. That is why I suspect that the correct environment must be sourced in order to get GLIBCXX and CXXABI right.

juxeii commented 2 years ago

Neverming, I used RemoteCommand for ssh_config to source the env.

matepek commented 2 years ago

For future visitors: F.A.Q