Mir

Merge lp:~afrantzis/mir/build-options-for-tests into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Chris Gagnon
Approved revision: no longer in the source branch.
Merged at revision: 1334
Proposed branch: lp:~afrantzis/mir/build-options-for-tests
Merge into: lp:mir
Diff against target: 170 lines (+57/-29)
5 files modified
cmake/MirCommon.cmake (+7/-4)
tests/CMakeLists.txt (+14/-10)
tests/acceptance-tests/CMakeLists.txt (+12/-7)
tests/integration-tests/CMakeLists.txt (+12/-7)
tests/unit-tests/CMakeLists.txt (+12/-1)
To merge this branch: bzr merge lp:~afrantzis/mir/build-options-for-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Chris Gagnon (community) Approve
Daniel van Vugt Approve
Alan Griffiths Approve
Review via email: mp+197051@code.launchpad.net

This proposal supersedes a proposal from 2013-11-28.

Commit message

build: Expose options to allow building but not running tests by default

Description of the change

build: Expose options to allow building but not running tests by default

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

LGTM

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

Seems OK but I suggest there's no need for options: MIR_BUILD_*_TESTS
We only really need options for MIR_RUN_*_TESTS.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Note: this MP affects CMake options used by the CI scripts, so we need to coordinate with CI before landing this.

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

We've been trying to land it for days, so please do coordinate :)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

Build hooks have been added to the armhf builders approve for landing

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cmake/MirCommon.cmake'
--- cmake/MirCommon.cmake 2014-01-10 03:59:43 +0000
+++ cmake/MirCommon.cmake 2014-01-13 17:30:43 +0000
@@ -1,11 +1,14 @@
1cmake_minimum_required (VERSION 2.6)1cmake_minimum_required (VERSION 2.6)
2# Create target to discover tests2# Create target to discover tests
33
4option(4include(CMakeDependentOption)
5
6CMAKE_DEPENDENT_OPTION(
5 DISABLE_GTEST_TEST_DISCOVERY7 DISABLE_GTEST_TEST_DISCOVERY
6 "If set to ON, disables fancy test autodiscovery and switches back to classic add_test behavior"8 "If set to ON, disables fancy test autodiscovery and switches back to classic add_test behavior"
7 OFF9 OFF
8)10 "NOT MIR_IS_CROSS_COMPILING"
11 ON)
912
10option(13option(
11 ENABLE_MEMCHECK_OPTION14 ENABLE_MEMCHECK_OPTION
@@ -34,7 +37,7 @@
34endif(ENABLE_MEMCHECK_OPTION)37endif(ENABLE_MEMCHECK_OPTION)
3538
36function (mir_discover_tests EXECUTABLE)39function (mir_discover_tests EXECUTABLE)
37 if(BUILD_ANDROID OR DISABLE_GTEST_TEST_DISCOVERY)40 if(DISABLE_GTEST_TEST_DISCOVERY)
38 add_test(${EXECUTABLE} ${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} "${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE}")41 add_test(${EXECUTABLE} ${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} "${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE}")
3942
40 if (${ARGC} GREATER 1)43 if (${ARGC} GREATER 1)
@@ -81,7 +84,7 @@
8184
82function (mir_add_memcheck_test)85function (mir_add_memcheck_test)
83 if (ENABLE_MEMCHECK_OPTION)86 if (ENABLE_MEMCHECK_OPTION)
84 if(BUILD_ANDROID OR DISABLE_GTEST_TEST_DISCOVERY)87 if(DISABLE_GTEST_TEST_DISCOVERY)
85 ADD_TEST("memcheck-test" "sh" "-c" "${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} ${CMAKE_BINARY_DIR}/mir_gtest/mir_test_memory_error; if [ $? != 0 ]; then exit 0; else exit 1; fi")88 ADD_TEST("memcheck-test" "sh" "-c" "${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} ${CMAKE_BINARY_DIR}/mir_gtest/mir_test_memory_error; if [ $? != 0 ]; then exit 0; else exit 1; fi")
86 else()89 else()
87 add_custom_target(90 add_custom_target(
8891
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2014-01-13 11:36:15 +0000
+++ tests/CMakeLists.txt 2014-01-13 17:30:43 +0000
@@ -23,17 +23,21 @@
23 ${PROJECT_SOURCE_DIR}/include/client23 ${PROJECT_SOURCE_DIR}/include/client
24 ${PROJECT_SOURCE_DIR}/include/test)24 ${PROJECT_SOURCE_DIR}/include/test)
2525
26option(MIR_ENABLE_ACCEPTANCE_TESTS "Build & run acceptance tests" ON)26option(MIR_BUILD_ACCEPTANCE_TESTS "Build acceptance tests" ON)
27option(MIR_ENABLE_INTEGRATION_TESTS "Build & run integration tests" ON)27option(MIR_BUILD_INTEGRATION_TESTS "Build integration tests" ON)
28option(MIR_ENABLE_UNIT_TESTS "Build & run unit tests" ON)28option(MIR_BUILD_UNIT_TESTS "Build unit tests" ON)
2929
30add_subdirectory(acceptance-tests/)30if (MIR_BUILD_ACCEPTANCE_TESTS)
31add_subdirectory(integration-tests/)31 add_subdirectory(acceptance-tests/)
3232endif (MIR_BUILD_ACCEPTANCE_TESTS)
33#we check the other tests in their own cmake file33
34if (MIR_ENABLE_UNIT_TESTS)34if (MIR_BUILD_INTEGRATION_TESTS)
35 add_subdirectory(integration-tests/)
36endif (MIR_BUILD_INTEGRATION_TESTS)
37
38if (MIR_BUILD_UNIT_TESTS)
35 add_subdirectory(unit-tests/)39 add_subdirectory(unit-tests/)
36endif (MIR_ENABLE_UNIT_TESTS)40endif (MIR_BUILD_UNIT_TESTS)
3741
38add_subdirectory(mir_test/)42add_subdirectory(mir_test/)
39add_subdirectory(mir_test_framework/)43add_subdirectory(mir_test_framework/)
4044
=== modified file 'tests/acceptance-tests/CMakeLists.txt'
--- tests/acceptance-tests/CMakeLists.txt 2014-01-13 11:36:15 +0000
+++ tests/acceptance-tests/CMakeLists.txt 2014-01-13 17:30:43 +0000
@@ -1,3 +1,5 @@
1include(CMakeDependentOption)
2
1include_directories(3include_directories(
2 ${CMAKE_SOURCE_DIR}4 ${CMAKE_SOURCE_DIR}
3 ${PROTOBUF_INCLUDE_DIRS}5 ${PROTOBUF_INCLUDE_DIRS}
@@ -65,13 +67,16 @@
65 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.67 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
66)68)
6769
68if (MIR_PLATFORM STREQUAL "android")70CMAKE_DEPENDENT_OPTION(
69 #don't discover the test, we'll run it later on a phone71 MIR_RUN_ACCEPTANCE_TESTS
70else()72 "Run acceptance tests as part of default testing"
71 if(MIR_ENABLE_ACCEPTANCE_TESTS)73 ON
72 mir_discover_tests(mir_acceptance_tests)74 "MIR_BUILD_ACCEPTANCE_TESTS"
73 endif()75 OFF)
74endif()76
77if (MIR_RUN_ACCEPTANCE_TESTS)
78 mir_discover_tests(mir_acceptance_tests)
79endif (MIR_RUN_ACCEPTANCE_TESTS)
7580
76install(81install(
77 TARGETS mir_acceptance_tests82 TARGETS mir_acceptance_tests
7883
=== modified file 'tests/integration-tests/CMakeLists.txt'
--- tests/integration-tests/CMakeLists.txt 2014-01-10 03:59:43 +0000
+++ tests/integration-tests/CMakeLists.txt 2014-01-13 17:30:43 +0000
@@ -1,3 +1,5 @@
1include(CMakeDependentOption)
2
1include_directories(${CMAKE_SOURCE_DIR})3include_directories(${CMAKE_SOURCE_DIR})
24
3set(5set(
@@ -64,13 +66,16 @@
64 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.66 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
65)67)
6668
67if (MIR_PLATFORM STREQUAL "android")69CMAKE_DEPENDENT_OPTION(
68 #don't discover the test, we'll run it later on a phone70 MIR_RUN_INTEGRATION_TESTS
69else()71 "Run integration tests as part of default testing"
70 if(MIR_ENABLE_INTEGRATION_TESTS)72 ON
71 mir_discover_tests(mir_integration_tests)73 "MIR_BUILD_INTEGRATION_TESTS"
72 endif()74 OFF)
73endif()75
76if (MIR_RUN_INTEGRATION_TESTS)
77 mir_discover_tests(mir_integration_tests)
78endif (MIR_RUN_INTEGRATION_TESTS)
7479
75install(80install(
76 TARGETS mir_integration_tests81 TARGETS mir_integration_tests
7782
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2014-01-10 03:59:43 +0000
+++ tests/unit-tests/CMakeLists.txt 2014-01-13 17:30:43 +0000
@@ -1,3 +1,5 @@
1include(CMakeDependentOption)
2
1add_definitions(-DTEST_RECORDINGS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/input_recordings/")3add_definitions(-DTEST_RECORDINGS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/input_recordings/")
24
3include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${UMOCKDEV_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR})5include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${UMOCKDEV_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR})
@@ -62,7 +64,16 @@
62 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")64 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
63endif()65endif()
6466
65mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)67CMAKE_DEPENDENT_OPTION(
68 MIR_RUN_UNIT_TESTS
69 "Run unit tests as part of default testing"
70 ON
71 "MIR_BUILD_UNIT_TESTS"
72 OFF)
73
74if (MIR_RUN_UNIT_TESTS)
75 mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)
76endif (MIR_RUN_UNIT_TESTS)
6677
67install(78install(
68 TARGETS mir_unit_tests79 TARGETS mir_unit_tests

Subscribers

People subscribed via source and target branches