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
=== modified file 'debian/control'
--- debian/control 2014-01-17 06:22:01 +0000
+++ debian/control 2014-01-23 08:33:38 +0000
@@ -31,8 +31,8 @@
31 libgoogle-glog-dev,31 libgoogle-glog-dev,
32 liblttng-ust-dev,32 liblttng-ust-dev,
33 libxkbcommon-dev,33 libxkbcommon-dev,
34 libumockdev-dev,34 libumockdev-dev [!armhf],
35 umockdev,35 umockdev [!armhf],
36 libudev-dev,36 libudev-dev,
37 google-mock (>= 1.6.0+svn437),37 google-mock (>= 1.6.0+svn437),
38 valgrind [!arm64],38 valgrind [!arm64],
3939
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2014-01-22 08:32:55 +0000
+++ tests/CMakeLists.txt 2014-01-23 08:33:38 +0000
@@ -1,6 +1,13 @@
1pkg_check_modules(UMOCKDEV REQUIRED umockdev-1.0)1
2if (NOT UMOCKDEV_FOUND)2if (MIR_PLATFORM STREQUAL "mesa")
3 message(FATAL_ERROR "Umockdev not found, cannot build without disabling tests (via MIR_ENABLE_TESTS).")3 set (UMOCKDEV_REQUIRED YES)
4endif()
5
6if (UMOCKDEV_REQUIRED)
7 pkg_check_modules(UMOCKDEV REQUIRED umockdev-1.0)
8 if (NOT UMOCKDEV_FOUND)
9 message(FATAL_ERROR "Umockdev not found, cannot build without disabling tests (via MIR_ENABLE_TESTS).")
10 endif()
4endif()11endif()
512
6include_directories(${MIR_3RD_PARTY_INCLUDE_DIRECTORIES})13include_directories(${MIR_3RD_PARTY_INCLUDE_DIRECTORIES})
714
=== modified file 'tests/mir_test_framework/CMakeLists.txt'
--- tests/mir_test_framework/CMakeLists.txt 2014-01-22 08:32:55 +0000
+++ tests/mir_test_framework/CMakeLists.txt 2014-01-23 08:33:38 +0000
@@ -25,12 +25,13 @@
25 socket_detect_server.cpp25 socket_detect_server.cpp
26)26)
2727
28include_directories(${UMOCKDEV_INCLUDE_DIRS})28if (UMOCKDEV_REQUIRED)
29list(APPEND TEST_FRAMEWORK_SRCS29 include_directories(${UMOCKDEV_INCLUDE_DIRS})
30 udev_environment.cpp30 list(APPEND TEST_FRAMEWORK_SRCS udev_environment.cpp)
31)31 list(APPEND TEST_FRAMEWORK_LIBS ${UMOCKDEV_LIBRARIES})
32# Umockdev uses glib, which uses the deprecated "register" storage qualifier32 # Umockdev uses glib, which uses the deprecated "register" storage qualifier
33set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")33 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
34endif ()
3435
35add_library(36add_library(
36 mir-test-framework STATIC37 mir-test-framework STATIC
@@ -53,8 +54,6 @@
53 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.54 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
54)55)
5556
56target_link_libraries(57target_link_libraries(mir-test-framework
57 mir-test-framework58 ${TEST_FRAMEWORK_LIBS}
58
59 ${UMOCKDEV_LIBRARIES}
60)59)
6160
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2014-01-22 08:32:55 +0000
+++ tests/unit-tests/CMakeLists.txt 2014-01-23 08:33:38 +0000
@@ -11,9 +11,12 @@
11 test_asio_main_loop.cpp11 test_asio_main_loop.cpp
12 shared_library_test.cpp12 shared_library_test.cpp
13 test_raii.cpp13 test_raii.cpp
14 test_udev_wrapper.cpp
15)14)
1615
16if (UMOCKDEV_REQUIRED)
17 list(APPEND UNIT_TEST_SOURCES test_udev_wrapper.cpp)
18endif ()
19
17add_subdirectory(options/)20add_subdirectory(options/)
18add_subdirectory(client/)21add_subdirectory(client/)
19add_subdirectory(compositor/)22add_subdirectory(compositor/)
@@ -55,13 +58,11 @@
55 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.58 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
56)59)
5760
58target_link_libraries(61if (UMOCKDEV_REQUIRED)
59 mir_unit_tests62 target_link_libraries(mir_unit_tests ${UMOCKDEV_LIBRARIES})
6063 # Umockdev uses glib, which uses the deprecated "register" allocation specifier
61 ${UMOCKDEV_LIBRARIES}64 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
62)65endif ()
63# Umockdev uses glib, which uses the deprecated "register" allocation specifier
64set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
6566
66CMAKE_DEPENDENT_OPTION(67CMAKE_DEPENDENT_OPTION(
67 MIR_RUN_UNIT_TESTS68 MIR_RUN_UNIT_TESTS
@@ -71,7 +72,11 @@
71 OFF)72 OFF)
7273
73if (MIR_RUN_UNIT_TESTS)74if (MIR_RUN_UNIT_TESTS)
74 mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)75 if (UMOCKDEV_REQUIRED)
76 mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)
77 else ()
78 mir_discover_tests(mir_unit_tests)
79 endif ()
75endif (MIR_RUN_UNIT_TESTS)80endif (MIR_RUN_UNIT_TESTS)
7681
77install(82install(

Subscribers

People subscribed via source and target branches