-
Notifications
You must be signed in to change notification settings - Fork 120
Fix test_platform_prober conditional compilation when x11 or wayland platforms excluded #4636
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
|
@copilot while here, there's tests that also unconditionally, expect the |
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Done in 7f0bda7. Added guards for:
|
| temporary_env.emplace_back(std::make_unique<mtf::TemporaryEnvironmentValue>("MIR_SERVER_VIRTUAL_OUTPUT", "1280x1024")); | ||
| } | ||
|
|
||
| #if defined(MIR_BUILD_PLATFORM_WAYLAND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot you also need to define MIR_BUILD_PLATFORM_WAYLAND when it is enabled in the build. See tests/unit-tests/CMakeLists.txt:16 for the similar MIR_BUILD_PLATFORM_X11 definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please work on the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8ea7f63. Added add_compile_definitions(MIR_BUILD_PLATFORM_WAYLAND) in tests/unit-tests/CMakeLists.txt following the same pattern as X11.
Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
TICS Quality Gate✔️ PassedNo changed files applicable for TICS analysis quality gating. TICS / TICS / Run TICS analysis |
Related: Issue mentions build failures when
x11is excluded fromMIR_PLATFORMWhat's new?
test_platform_prober.cppunconditionally usedMockX11and Wayland platform code, causing link failures when these platforms weren't built. All platform-specific test code is now properly guarded:X11 platform guards (
#if defined(MIR_BUILD_PLATFORM_X11)):#include <mir/test/doubles/mock_x11.h>testing::NiceMock<mtd::MockX11> x11;inFullProbeStackenable_host_x11()definitionWayland platform guards (
#if defined(MIR_BUILD_PLATFORM_WAYLAND)):enable_host_wayland()definitionCombined X11 and Wayland guards (
#if defined(MIR_BUILD_PLATFORM_X11) && defined(MIR_BUILD_PLATFORM_WAYLAND)):Build system updates:
add_compile_definitions(MIR_BUILD_PLATFORM_WAYLAND)intests/unit-tests/CMakeLists.txtto define the Wayland platform macro for conditional compilationPattern matches existing platform conditionals for GBM_KMS, ATOMIC_KMS, X11, and EGLSTREAM_KMS.
How to test
Build with
MIR_PLATFORMexcludingx11- should compile without linker errors. Build withMIR_PLATFORMexcludingwayland- should compile without linker errors. Build with both platforms included - all tests should run as before.Checklist
Original prompt
test_platform_proberassumes thex11platform is built #4635💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.