Mir

Merge lp:~vanvugt/mir/fix-1271434 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1354
Proposed branch: lp:~vanvugt/mir/fix-1271434
Merge into: lp:mir
Diff against target: 120 lines (+35/-24)
4 files modified
debian/control (+2/-2)
tests/CMakeLists.txt (+10/-3)
tests/mir_test_framework/CMakeLists.txt (+9/-10)
tests/unit-tests/CMakeLists.txt (+14/-9)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1271434
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+202800@code.launchpad.net

Commit message

Avoid linking to umockdev on platforms (android) which don't yet use it.
This allows mir_unit_tests to run on touch images again (LP: #1271434)

Description of the change

Technically the dependency on udev is also unused on Android right now. But that's tangled up in "mirplatform", which requires further work to make conditional.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

This certainly fixes the "can't run" problem - but I wonder if this is the right fix - why did we introduce a dependency on umockdev?

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The change occurred in r1343. RAOF hinted that it might be used in future input testing, but obviously not yet.

As long as umockdev isn't used on Android, I'd like to not link to it. Being able to copy Mir bin+lib to a fresh touch image and instantly run all the tests is very handy.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Sure

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-01-17 06:22:01 +0000
3+++ debian/control 2014-01-23 08:33:38 +0000
4@@ -31,8 +31,8 @@
5 libgoogle-glog-dev,
6 liblttng-ust-dev,
7 libxkbcommon-dev,
8- libumockdev-dev,
9- umockdev,
10+ libumockdev-dev [!armhf],
11+ umockdev [!armhf],
12 libudev-dev,
13 google-mock (>= 1.6.0+svn437),
14 valgrind [!arm64],
15
16=== modified file 'tests/CMakeLists.txt'
17--- tests/CMakeLists.txt 2014-01-22 08:32:55 +0000
18+++ tests/CMakeLists.txt 2014-01-23 08:33:38 +0000
19@@ -1,6 +1,13 @@
20-pkg_check_modules(UMOCKDEV REQUIRED umockdev-1.0)
21-if (NOT UMOCKDEV_FOUND)
22- message(FATAL_ERROR "Umockdev not found, cannot build without disabling tests (via MIR_ENABLE_TESTS).")
23+
24+if (MIR_PLATFORM STREQUAL "mesa")
25+ set (UMOCKDEV_REQUIRED YES)
26+endif()
27+
28+if (UMOCKDEV_REQUIRED)
29+ pkg_check_modules(UMOCKDEV REQUIRED umockdev-1.0)
30+ if (NOT UMOCKDEV_FOUND)
31+ message(FATAL_ERROR "Umockdev not found, cannot build without disabling tests (via MIR_ENABLE_TESTS).")
32+ endif()
33 endif()
34
35 include_directories(${MIR_3RD_PARTY_INCLUDE_DIRECTORIES})
36
37=== modified file 'tests/mir_test_framework/CMakeLists.txt'
38--- tests/mir_test_framework/CMakeLists.txt 2014-01-22 08:32:55 +0000
39+++ tests/mir_test_framework/CMakeLists.txt 2014-01-23 08:33:38 +0000
40@@ -25,12 +25,13 @@
41 socket_detect_server.cpp
42 )
43
44-include_directories(${UMOCKDEV_INCLUDE_DIRS})
45-list(APPEND TEST_FRAMEWORK_SRCS
46- udev_environment.cpp
47-)
48-# Umockdev uses glib, which uses the deprecated "register" storage qualifier
49-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
50+if (UMOCKDEV_REQUIRED)
51+ include_directories(${UMOCKDEV_INCLUDE_DIRS})
52+ list(APPEND TEST_FRAMEWORK_SRCS udev_environment.cpp)
53+ list(APPEND TEST_FRAMEWORK_LIBS ${UMOCKDEV_LIBRARIES})
54+ # Umockdev uses glib, which uses the deprecated "register" storage qualifier
55+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
56+endif ()
57
58 add_library(
59 mir-test-framework STATIC
60@@ -53,8 +54,6 @@
61 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
62 )
63
64-target_link_libraries(
65- mir-test-framework
66-
67- ${UMOCKDEV_LIBRARIES}
68+target_link_libraries(mir-test-framework
69+ ${TEST_FRAMEWORK_LIBS}
70 )
71
72=== modified file 'tests/unit-tests/CMakeLists.txt'
73--- tests/unit-tests/CMakeLists.txt 2014-01-22 08:32:55 +0000
74+++ tests/unit-tests/CMakeLists.txt 2014-01-23 08:33:38 +0000
75@@ -11,9 +11,12 @@
76 test_asio_main_loop.cpp
77 shared_library_test.cpp
78 test_raii.cpp
79- test_udev_wrapper.cpp
80 )
81
82+if (UMOCKDEV_REQUIRED)
83+ list(APPEND UNIT_TEST_SOURCES test_udev_wrapper.cpp)
84+endif ()
85+
86 add_subdirectory(options/)
87 add_subdirectory(client/)
88 add_subdirectory(compositor/)
89@@ -55,13 +58,11 @@
90 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
91 )
92
93-target_link_libraries(
94- mir_unit_tests
95-
96- ${UMOCKDEV_LIBRARIES}
97-)
98-# Umockdev uses glib, which uses the deprecated "register" allocation specifier
99-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
100+if (UMOCKDEV_REQUIRED)
101+ target_link_libraries(mir_unit_tests ${UMOCKDEV_LIBRARIES})
102+ # Umockdev uses glib, which uses the deprecated "register" allocation specifier
103+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
104+endif ()
105
106 CMAKE_DEPENDENT_OPTION(
107 MIR_RUN_UNIT_TESTS
108@@ -71,7 +72,11 @@
109 OFF)
110
111 if (MIR_RUN_UNIT_TESTS)
112- mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)
113+ if (UMOCKDEV_REQUIRED)
114+ mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)
115+ else ()
116+ mir_discover_tests(mir_unit_tests)
117+ endif ()
118 endif (MIR_RUN_UNIT_TESTS)
119
120 install(

Subscribers

People subscribed via source and target branches