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

CMake: Add GTA Run Settings #144

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

thbeu
Copy link
Contributor

@thbeu thbeu commented Aug 12, 2024

This PR generates the Run Settings file for the GoogleTestAdapter (GTA) with the expected working directory to run the GoogleTest based unit tests from Test Explorer in Visual Studio.

image

Resolves #143

@thbeu thbeu changed the title Add GTA Run Settings CMake: Add GTA Run Settings Aug 12, 2024
@rouault
Copy link
Member

rouault commented Aug 12, 2024

I'm a bit skeptical about such a IDE specific setting. Isn't rather the issue the WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" at line 31 of tests/CMakeLists.txt that should be instead ${CMAKE_SOURCE_DIR}/tests ?

@thbeu
Copy link
Contributor Author

thbeu commented Aug 12, 2024

Isn't rather the issue the WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" at line 31 of tests/CMakeLists.txt that should be instead ${CMAKE_SOURCE_DIR}/tests ?

According to all my many tries and the cited issue #143 there is no such CMake only fix to get the GTA running with proper working directory.

@rouault
Copy link
Member

rouault commented Aug 12, 2024

hum, but I'm puzzled by the discrepency between the existing ${PROJECT_SOURCE_DIR} in tests/CMakeLists.txt and @CMAKE_SOURCE_DIR@/tests in the new file of this PR. Any explanation why they don't match?

@thbeu
Copy link
Contributor Author

thbeu commented Aug 12, 2024

hum, but I'm puzzled by the discrepency between the existing ${PROJECT_SOURCE_DIR} in tests/CMakeLists.txt and @CMAKE_SOURCE_DIR@/tests in the new file of this PR. Any explanation why they don't match?

PROJECT_SOURCE_DIR of /tests/ subdir is the same as CMAKE_SOURCE_DIR/tests.

OK, fixed it. Now it relies on configure_file being called from /tests/CMakeLists.txt project.

Alternatively a UNITTEST_DIR variable could be introduced.

@rouault
Copy link
Member

rouault commented Aug 12, 2024

PROJECT_SOURCE_DIR of /tests/ subdir is the same as CMAKE_SOURCE_DIR/tests.

oh, I missed that tests/CMakeLists.txt defined a new project()...

The new file should also be listed in EXTRA_DIST of top Makefile.am

@thbeu
Copy link
Contributor Author

thbeu commented Aug 12, 2024

The new file should also be listed in EXTRA_DIST of top Makefile.am

I already did.

@rouault rouault merged commit c0582fe into OSGeo:master Aug 12, 2024
7 checks passed
@thbeu thbeu deleted the add-gta-runsettings branch August 12, 2024 17:57
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.

GoogleTestAdapter in Visual Studio
2 participants