mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
osx fix and enable tests
This commit is contained in:
committed by
Lorenz Meier
parent
ba047f234d
commit
8b9bef3872
+1
-1
@@ -63,7 +63,7 @@ script:
|
|||||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||||
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=1";
|
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=1";
|
||||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||||
make check_posix_sitl_default;
|
make tests;
|
||||||
fi
|
fi
|
||||||
- ccache -s
|
- ccache -s
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
uorb start
|
uorb start
|
||||||
|
|
||||||
param load
|
param load
|
||||||
param set SYS_RESTART_TYPE 0
|
param set SYS_RESTART_TYPE 0
|
||||||
|
|
||||||
dataman start
|
dataman start
|
||||||
|
|
||||||
|
rgbledsim start
|
||||||
|
tone_alarm start
|
||||||
|
|
||||||
ver all
|
ver all
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|||||||
+14
-39
@@ -7,11 +7,11 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|||||||
add_compile_options(-Qunused-arguments)
|
add_compile_options(-Qunused-arguments)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(unittests)
|
project(px4_unittests)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -std=gnu99 -g")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -std=gnu99 -g")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++11 -g -fno-exceptions -fno-rtti -fno-threadsafe-statics")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=gnu++0x -g -fno-exceptions -fno-rtti -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__")
|
||||||
|
|
||||||
|
|
||||||
set(GTEST_DIR ${CMAKE_SOURCE_DIR}/googletest)
|
set(GTEST_DIR ${CMAKE_SOURCE_DIR}/googletest)
|
||||||
@@ -55,41 +55,16 @@ else()
|
|||||||
add_definitions(-D__PX4_LINUX)
|
add_definitions(-D__PX4_LINUX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(px4_platform
|
set(PX4_PLATFORM
|
||||||
${PX4_SITL_BUILD}/src/modules/param/px4_parameters.c
|
${PX4_SITL_BUILD}/libmsg_gen.a
|
||||||
${PX4_SRC}/drivers/device/device_posix.cpp
|
${PX4_SITL_BUILD}/src/drivers/boards/sitl/libdrivers__boards__sitl.a
|
||||||
${PX4_SRC}/drivers/device/i2c_posix.cpp
|
${PX4_SITL_BUILD}/src/drivers/device/libdrivers__device.a
|
||||||
${PX4_SRC}/drivers/device/ringbuffer.cpp
|
${PX4_SITL_BUILD}/src/lib/DriverFramework/framework/liblib__DriverFramework__framework.a
|
||||||
${PX4_SRC}/drivers/device/sim.cpp
|
${PX4_SITL_BUILD}/src/lib/DriverFramework/framework/src/libdf_driver_framework.a
|
||||||
${PX4_SRC}/drivers/device/vdev.cpp
|
${PX4_SITL_BUILD}/src/platforms/common/libplatforms__common.a
|
||||||
${PX4_SRC}/drivers/device/vdev_posix.cpp
|
${PX4_SITL_BUILD}/src/platforms/posix/px4_layer/libplatforms__posix__px4_layer.a
|
||||||
${PX4_SRC}/drivers/device/vfile.cpp
|
${PX4_SITL_BUILD}/src/platforms/posix/work_queue/libplatforms__posix__work_queue.a
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/drv_hrt.c
|
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/lib_crc32.c
|
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/px4_log.c
|
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/px4_log.c
|
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/px4_posix_impl.cpp
|
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/px4_posix_tasks.cpp
|
|
||||||
${PX4_SRC}/platforms/posix/px4_layer/px4_sem.cpp
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/dq_addlast.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/dq_rem.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/dq_remfirst.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/hrt_queue.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/hrt_thread.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/hrt_work_cancel.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/queue.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/sq_addafter.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/sq_addlast.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/sq_remfirst.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/work_cancel.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/work_lock.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/work_queue.c
|
|
||||||
${PX4_SRC}/platforms/posix/work_queue/work_thread.c
|
|
||||||
)
|
)
|
||||||
target_include_directories(px4_platform PUBLIC ${PX4_SRC}/platforms)
|
|
||||||
target_include_directories(px4_platform PUBLIC ${PX4_SRC}/platforms/posix/include)
|
|
||||||
target_include_directories(px4_platform PUBLIC ${PX4_SRC}/platforms/posix/work_queue)
|
|
||||||
|
|
||||||
|
|
||||||
# check
|
# check
|
||||||
add_custom_target(check
|
add_custom_target(check
|
||||||
@@ -101,9 +76,9 @@ add_custom_target(check
|
|||||||
function(add_gtest)
|
function(add_gtest)
|
||||||
foreach(test_name ${ARGN})
|
foreach(test_name ${ARGN})
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
target_link_libraries(${test_name} gtest_main pthread px4_platform)
|
target_link_libraries(${test_name} gtest_main pthread ${PX4_PLATFORM})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${test_name} gtest_main pthread rt px4_platform)
|
target_link_libraries(${test_name} gtest_main pthread rt ${PX4_PLATFORM})
|
||||||
endif()
|
endif()
|
||||||
add_test(NAME ${test_name} COMMAND ${test_name} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
add_test(NAME ${test_name} COMMAND ${test_name} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
add_dependencies(check ${test_name})
|
add_dependencies(check ${test_name})
|
||||||
@@ -121,5 +96,5 @@ endfunction()
|
|||||||
add_executable(param_test param_test.cpp uorb_stub.cpp
|
add_executable(param_test param_test.cpp uorb_stub.cpp
|
||||||
${PX4_SRC}/modules/systemlib/bson/tinybson.c
|
${PX4_SRC}/modules/systemlib/bson/tinybson.c
|
||||||
${PX4_SRC}/modules/systemlib/param/param.c)
|
${PX4_SRC}/modules/systemlib/param/param.c)
|
||||||
target_link_libraries(param_test ${PX4_SITL_BUILD}/libmsg_gen.a)
|
target_link_libraries(param_test ${PX4_PLATFORM})
|
||||||
add_gtest(param_test)
|
add_gtest(param_test)
|
||||||
|
|||||||
Reference in New Issue
Block a user