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

Actually Run All Unit Tests in CMake #19462

Merged
merged 4 commits into from Apr 3, 2023

Conversation

duncanspumpkin
Copy link
Contributor

Seems the majority of our tests haven't been running for any platform that uses cmake (i.e. non windows). This rewrites the cmake to a more modern style for the tests and adds all the tests.

I had to disable the tests on any platform that didn't have modern cmake installed as I'm using the newer gtest integration.

@duncanspumpkin
Copy link
Contributor Author

Hmm for some reason its not seeing the replays

Comment on lines -30 to -32
# Setup testdata. It should be fine here, as the only way to reach here is by explicitly requesting tests.
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_LIST_DIR}/testdata" "${CMAKE_CURRENT_BINARY_DIR}/testdata")
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/openrct2\" \"${CMAKE_CURRENT_BINARY_DIR}/data\")")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't find the data because of this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats really fun is that it does find the data when i run it locally :). I mean i know I've change the location of the executable but it should still work out. I've got another idea though that should fix it.

@duncanspumpkin duncanspumpkin marked this pull request as draft March 1, 2023 20:58
@github-actions
Copy link

This pull request is stale and will be closed in 14 days if no action is taken. To keep it open, leave a comment or remove the stale-pr label. If you're awaiting feedback from a developer, please send us a reminder (either here or on Discord).

@duncanspumpkin duncanspumpkin marked this pull request as ready for review March 30, 2023 07:36
@duncanspumpkin
Copy link
Contributor Author

Finally worked out why the replays weren't working, we install the replays during install post build but gtest_discover_tests by default runs post build preinstall. i.e. when it discovers the tests there are no replays.

@janisozaur janisozaur added this to the v0.4.5 milestone Mar 30, 2023
@janisozaur
Copy link
Member

cmake 3.20+ update:

#15501 (comment) BSD is already up to date
#15501 (comment) flatpak builders are up to date

@gibmat @TheAssassin we are planning to up the required cmake version to 3.20 or later

@gibmat
Copy link
Contributor

gibmat commented Mar 30, 2023

👍 bookworm will be shipping with cmake 3.25 -- sounds good to me!

Copy link
Member

@janisozaur janisozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiLaunchTest is now missing

@duncanspumpkin
Copy link
Contributor Author

MultiLaunchTest is now missing

I'm seeing multi launch in the test results:

132/202 Test #132: MultiLaunchTest.all

Pretty sure that's the only multi launch test.

@janisozaur
Copy link
Member

Odd, I couldn't find it. Perhaps just some quirk about how the test results are presented preventing browser search from working

@janisozaur janisozaur merged commit 049d962 into OpenRCT2:develop Apr 3, 2023
20 checks passed
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.

None yet

4 participants