Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

googletest executables are not showing up in vscode #397

Closed
ambitslix opened this issue Sep 23, 2023 · 11 comments
Closed

googletest executables are not showing up in vscode #397

ambitslix opened this issue Sep 23, 2023 · 11 comments
Labels
invalid This doesn't seem right

Comments

@ambitslix
Copy link

ambitslix commented Sep 23, 2023

Checklist

  • [x ] The issue is about this extension and NOT about a fork.
  • [x ] Check the known issues list.
  • [ x] The latest version of the extension was used.
  • [ x] It is not related to remote-vscode or I checked the following issue
  • [x ] Imagine yourself into my position and think how hard to debug the issue without insufficient information.
    I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
    Thanks.

Describe the bug

googletest executables are not showing up in vscode

To Reproduce

1. Fresh install of VScode under Ubuntu 22
2. Create cmake CPP project
3. build googletest module meaning a unit test that uses googletest
4. unit test executable is Not shown in test ui vscode sidebar
  • Extension Version: v4.6.0
  • VS Code Version:1.82.2
  • Catch2 / Google Test / DOCTest Version: Gtest v1.14.0
  • OS Type and Version: ubuntu 22.04
  • Using remote-ssh/docker/wsl?: Nope

Tried, but no previous version works at this point so perhaps issue is in vscode.

Logs
[2023-09-23 03:34:38.898] [INFO] Activating extension
[2023-09-23 03:34:38.900] [INFO] Activation finished
[2023-09-23 03:34:42.718] [INFO] `test.advancedExecutables` is not defined. trying to use `test.executables`
[2023-09-23 03:34:42.720] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: 'build/**/tests/**/*Test',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.724] [INFO] pattern build/**/tests/**/*Test /home/user {
  isAbsolute: false,
  absPath: '/home/user/build/**/tests/**/*Test',
  isPartOfWs: true,
  relativeToWsPosix: 'build/**/tests/**/*Test'
}
[2023-09-23 03:34:42.758] [DEBUG] Checking file for tests: /home/user/build/Linux_x86_64_Debug_Native/tests/Transcribe/TranscriberFactoryTest
[2023-09-23 03:34:42.758] [DEBUG] Checking file for tests: /home/user/build/Linux_x86_64_Debug_Native/tests/Generic/GenericTest
[2023-09-23 03:34:42.759] [DEBUG] Checking file for tests: /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/AwsSynthesizerTest
[2023-09-23 03:34:42.759] [DEBUG] Checking file for tests: /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/SynthesizerFactoryTest
[2023-09-23 03:34:42.759] [DEBUG] Checking file for tests: /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/NullSynthesizerTest
[2023-09-23 03:34:42.759] [DEBUG] Checking file for tests: /home/user/build/Linux_x86_64_Debug_Native/tests/Generic/MockTest
[2023-09-23 03:34:42.760] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.761] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: Promise { <pending> }, strictAllowed: true }
[2023-09-23 03:34:42.772] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.772] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: Promise { <pending> }, strictAllowed: true }
[2023-09-23 03:34:42.773] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.773] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: Promise { <pending> }, strictAllowed: true }
[2023-09-23 03:34:42.774] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.774] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: Promise { <pending> }, strictAllowed: true }
[2023-09-23 03:34:42.774] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.775] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: Promise { <pending> }, strictAllowed: true }
[2023-09-23 03:34:42.775] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: Promise { <pending> },
  strictAllowed: false
}
[2023-09-23 03:34:42.775] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: Promise { <pending> }, strictAllowed: true }
[2023-09-23 03:34:42.861] [INFO] reloadTests GoogleTest undefined /home/user/build/Linux_x86_64_Debug_Native/tests/Transcribe/TranscriberFactoryTest
[2023-09-23 03:34:42.862] [INFO] discovering tests /home/user/build/Linux_x86_64_Debug_Native/tests/Transcribe/TranscriberFactoryTest [
  '--gtest_list_tests',
  '--gtest_output=xml:/home/user/build/Linux_x86_64_Debug_Native/tests/Transcribe/TranscriberFactoryTest.TestMate.testListCache.xml'
] /home/user/build/Linux_x86_64_Debug_Native/tests/Transcribe
[2023-09-23 03:34:42.891] [DEBUG] findSourceFilePath: /home/user/tests/Transcribe/TranscriberFactoryTest.cpp => /home/user/tests/Transcribe/TranscriberFactoryTest.cpp
[2023-09-23 03:34:42.891] [INFO] testGrouping {
  testId: 'AwsTranscribeCaptureThreaded',
  resolvedFile: '/home/user/tests/Transcribe/TranscriberFactoryTest.cpp',
  tags: [ 'Transcribe' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.895] [INFO] reloadTests GoogleTest undefined /home/user/build/Linux_x86_64_Debug_Native/tests/Generic/GenericTest
[2023-09-23 03:34:42.896] [INFO] discovering tests /home/user/build/Linux_x86_64_Debug_Native/tests/Generic/GenericTest [
  '--gtest_list_tests',
  '--gtest_output=xml:/home/user/build/Linux_x86_64_Debug_Native/tests/Generic/GenericTest.TestMate.testListCache.xml'
] /home/user/build/Linux_x86_64_Debug_Native/tests/Generic
[2023-09-23 03:34:42.911] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.911] [INFO] testGrouping {
  testId: 'Logic',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.912] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.912] [INFO] testGrouping {
  testId: 'Piece',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.913] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.913] [INFO] testGrouping {
  testId: 'Move',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.913] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.913] [INFO] testGrouping {
  testId: 'Position',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.914] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.914] [INFO] testGrouping {
  testId: 'Sequence',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.915] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.915] [INFO] testGrouping {
  testId: 'PositionToFEN',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.915] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.915] [INFO] testGrouping {
  testId: 'Message',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.916] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.916] [INFO] testGrouping {
  testId: 'HashTableSaturation',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.916] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.916] [INFO] testGrouping {
  testId: 'PackedPositionHash',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.917] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.917] [INFO] testGrouping {
  testId: 'PackedPositionMove',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.917] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.917] [INFO] testGrouping {
  testId: 'PackedPositionUnMove',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.918] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.918] [INFO] testGrouping {
  testId: 'ZArray',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.918] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.918] [INFO] testGrouping {
  testId: 'XMap',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.918] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.918] [INFO] testGrouping {
  testId: 'ZMap',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.919] [DEBUG] findSourceFilePath: /home/user/tests/Generic/GenericTest.cpp => /home/user/tests/Generic/GenericTest.cpp
[2023-09-23 03:34:42.919] [INFO] testGrouping {
  testId: 'QMap',
  resolvedFile: '/home/user/tests/Generic/GenericTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.920] [INFO] reloadTests GoogleTest undefined /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/AwsSynthesizerTest
[2023-09-23 03:34:42.920] [INFO] discovering tests /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/AwsSynthesizerTest [
  '--gtest_list_tests',
  '--gtest_output=xml:/home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/AwsSynthesizerTest.TestMate.testListCache.xml'
] /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize
[2023-09-23 03:34:42.944] [DEBUG] findSourceFilePath: /home/user/tests/Synthesize/AwsSynthesizerTest.cpp => /home/user/tests/Synthesize/AwsSynthesizerTest.cpp
[2023-09-23 03:34:42.944] [INFO] testGrouping {
  testId: 'AwSynthesizer',
  resolvedFile: '/home/user/tests/Synthesize/AwsSynthesizerTest.cpp',
  tags: [ 'Output' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.946] [INFO] reloadTests GoogleTest undefined /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/SynthesizerFactoryTest
[2023-09-23 03:34:42.946] [INFO] discovering tests /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/SynthesizerFactoryTest [
  '--gtest_list_tests',
  '--gtest_output=xml:/home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/SynthesizerFactoryTest.TestMate.testListCache.xml'
] /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize
[2023-09-23 03:34:42.973] [DEBUG] findSourceFilePath: /home/user/tests/Synthesize/SynthesizerFactoryTest.cpp => /home/user/tests/Synthesize/SynthesizerFactoryTest.cpp
[2023-09-23 03:34:42.973] [INFO] testGrouping {
  testId: 'Synthesizer',
  resolvedFile: '/home/user/tests/Synthesize/SynthesizerFactoryTest.cpp',
  tags: [ 'Output' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.980] [INFO] reloadTests GoogleTest undefined /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/NullSynthesizerTest
[2023-09-23 03:34:42.980] [INFO] discovering tests /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/NullSynthesizerTest [
  '--gtest_list_tests',
  '--gtest_output=xml:/home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize/NullSynthesizerTest.TestMate.testListCache.xml'
] /home/user/build/Linux_x86_64_Debug_Native/tests/Synthesize
[2023-09-23 03:34:42.996] [DEBUG] findSourceFilePath: /home/user/tests/Synthesize/NullSynthesizerTest.cpp => /home/user/tests/Synthesize/NullSynthesizerTest.cpp
[2023-09-23 03:34:42.996] [INFO] testGrouping {
  testId: 'NullSynthesizer',
  resolvedFile: '/home/user/tests/Synthesize/NullSynthesizerTest.cpp',
  tags: [ 'Output' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:42.997] [INFO] reloadTests GoogleTest undefined /home/user/build/Linux_x86_64_Debug_Native/tests/Generic/MockTest
[2023-09-23 03:34:42.997] [INFO] discovering tests /home/user/build/Linux_x86_64_Debug_Native/tests/Generic/MockTest [
  '--gtest_list_tests',
  '--gtest_output=xml:/home/user/build/Linux_x86_64_Debug_Native/tests/Generic/MockTest.TestMate.testListCache.xml'
] /home/user/build/Linux_x86_64_Debug_Native/tests/Generic
[2023-09-23 03:34:43.010] [DEBUG] findSourceFilePath: /home/user/tests/Generic/MockTest.cpp => /home/user/tests/Generic/MockTest.cpp
[2023-09-23 03:34:43.010] [INFO] testGrouping {
  testId: 'pieceTypeNormalized',
  resolvedFile: '/home/user/tests/Generic/MockTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
[2023-09-23 03:34:43.011] [DEBUG] findSourceFilePath: /home/user/tests/Generic/MockTest.cpp => /home/user/tests/Generic/MockTest.cpp
[2023-09-23 03:34:43.011] [INFO] testGrouping {
  testId: 'positionValid',
  resolvedFile: '/home/user/tests/Generic/MockTest.cpp',
  tags: [ 'Generic' ],
  testGrouping: {
    groupByExecutable: {
      label: undefined,
      description: undefined,
      groupByTags: { tags: [], tagFormat: '${tag}' }
    }
  }
}
@matepek matepek added the question Further information is requested label Sep 23, 2023
@matepek
Copy link
Owner

matepek commented Sep 23, 2023

  • what is the name of your executable?
  • Do they depend on some dynamic library?

@ambitslix
Copy link
Author

ambitslix commented Sep 23, 2023

Hello, so I was lucky enough to quickly narrow down what causes this issue. It's very hard to find. It is this line

ADD_TEST (${SRC} ${Test})

in the CMakelists.txt which would "Add a test to the project to be run by ctest"

https://cmake.org/cmake/help/latest/command/add_test.html

In my case ${SRC}=name of the test

and

${Test}=executable

@matepek
Copy link
Owner

matepek commented Sep 23, 2023

I don't think so. This extension does not parse ctest.
More like your cmake did not compile the the test executable without this line. (I assume)

@matepek matepek closed this as completed Sep 23, 2023
@ambitslix
Copy link
Author

ambitslix commented Sep 23, 2023

  • what is the name of your executable?
  • Do they depend on some dynamic library?

No it does not depend and it's name was GenericTest, you can see that in the log.

@matepek matepek added invalid This doesn't seem right and removed question Further information is requested labels Sep 23, 2023
@ambitslix
Copy link
Author

I don't think so. This extension does not parse ctest. More like your cmake did not compile the the test executable without this line. (I assume)

The test executables build fine with or without the ADD_TEST.

@matepek
Copy link
Owner

matepek commented Sep 23, 2023

Then I'm confused. This extension has nothing to do with ctest.
Are you sure you are not using the https://marketplace.visualstudio.com/items?itemName=fredericbonnet.cmake-test-adapter extension. Maybe if you uninstall my extension you still will see the tests because of that other extension,

@ambitslix
Copy link
Author

ambitslix commented Sep 23, 2023

Then I'm confused. This extension has nothing to do with ctest. Are you sure you are not using the https://marketplace.visualstudio.com/items?itemName=fredericbonnet.cmake-test-adapter extension. Maybe if you uninstall this extension you still will see the tests because of that other extension

I'm definitely not using cmake-test-adapter. I had wiped all of vscode and settings from my home dir before carefully installing everything again.

@ambitslix
Copy link
Author

I still suspect this issue is not test-mate's fault as the log seems to be good.

@matepek
Copy link
Owner

matepek commented Sep 23, 2023

The logs above showing that my extension found tests but you still reported them missing.
I still suspect that some other extension is interfering.

@ambitslix
Copy link
Author

ambitslix commented Sep 23, 2023

It cannot be another extension because in my other independent project it works fine. I can build them at the same time from two separate vscode windows. My workspace settings are also the same. I can run the tests from the cli. They both link same version of gtest.

@ambitslix
Copy link
Author

ambitslix commented Sep 23, 2023

I fixed this issue by removing vscode completely including all configuration files from my system and then re-installing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants