Skip to content

fix: Replace gtest_discover_tests for Visual Studio 2022 builds - #2229

Merged
RobBuchananCompPhys merged 3 commits into
developfrom
fix/vs2022-build-tests
Sep 4, 2025
Merged

RobBuchananCompPhys merged 3 commits into
developfrom
fix/vs2022-build-tests

Conversation

@RobBuchananCompPhys

@RobBuchananCompPhys RobBuchananCompPhys commented Sep 3, 2025 •

Copy link
Copy Markdown
Contributor

DIssolve GTest unit tests have been failing to build in our Visual Studio 2022 (MSVC) setup. The failure appears to be related to a timeout at the link step* when GTest is attempting to run a test executable. I have found that swapping out the call to gtest_discover_tests with the lower-level CTest add_test gets around this hang, allow the tests to proceed to link and allows for running and debugging.

*See the example below:

  CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:132 (message):
    Error running test executable.
  
      Path: 'C:/Users/vcb31993/source/repos/disorderedmaterials/dissolve/build/bin/nodes_graph_argon.exe'
      Working directory: 'C:/Users/vcb31993/source/repos/disorderedmaterials/dissolve/tests/data'
      Result: Process terminated due to timeout
      Output:

@RobBuchananCompPhys
RobBuchananCompPhys merged commit 080eb63 into develop Sep 4, 2025
25 of 28 checks passed
@RobBuchananCompPhys
RobBuchananCompPhys deleted the fix/vs2022-build-tests branch September 4, 2025 13:36
@github-actions github-actions Bot mentioned this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants