src/platforms/posix: move to platforms/posix/src/px4/common and src/drivers/driver_framework_wrapper

This commit is contained in:
Beat Küng
2019-08-30 07:59:44 +02:00
parent fa8165a1c3
commit 5d0e72040c
38 changed files with 22 additions and 19 deletions
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_ak8963_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_bebop_bus_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_bebop_rangefinder_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_bmp280_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_hmc5883_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_isl29501_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_lsm9ds1_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_ltc2946_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_mpu6050_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_mpu9250_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_ms5607_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_ms5611_wrapper
@@ -31,7 +31,7 @@
#
############################################################################
include_directories(../../../../lib/DriverFramework/drivers)
include_directories(../../../lib/DriverFramework/drivers)
px4_add_module(
MODULE platforms__posix__drivers__df_trone_wrapper
-4
View File
@@ -33,7 +33,3 @@
add_subdirectory(common)
if (${PX4_PLATFORM} STREQUAL "posix" AND BUILD_TESTING)
add_subdirectory(posix/test_stubs)
add_subdirectory(posix/gtest_runner)
endif()
@@ -1,39 +0,0 @@
############################################################################
#
# Copyright (c) 2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
set(SRCS
gtest_functional_main.cpp
)
px4_add_library(gtest_functional_main ${SRCS})
target_link_libraries(gtest_functional_main PUBLIC gtest)
@@ -1,45 +0,0 @@
/****************************************************************************
*
* Copyright (c) 2012-2019 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <gtest/gtest.h>
#include <uORB/Subscription.hpp>
int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
uORB::Manager::initialize();
param_init();
return RUN_ALL_TESTS();
}
@@ -1,41 +0,0 @@
############################################################################
#
# Copyright (c) 2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
set(SRCS
stub_daemon.cpp
stub_devmgr.cpp
stub_parameter.cpp
)
px4_add_library(test_stubs ${SRCS})
message("-- ADDING TEST STUBS")
@@ -1,6 +0,0 @@
#include "stub_daemon.h"
void init_app_map(apps_map_type &apps) {stub_init_app_map_callback(apps);}
void list_builtins(apps_map_type &apps) {stub_list_builtins_callback(apps);}
@@ -1,8 +0,0 @@
#pragma once
#include <platforms/posix/apps.h>
#include <functional>
std::function<void(apps_map_type &apps)> stub_init_app_map_callback = [](apps_map_type &) {};
std::function<void(apps_map_type &apps)> stub_list_builtins_callback = [](apps_map_type &) {};
@@ -1,10 +0,0 @@
#include "stub_devmgr.h"
namespace DriverFramework
{
int DevMgr::getNextDeviceName(unsigned int &index, const char **instancename)
{
return stub_getNextDeviceName_callback(index, instancename);
}
}
@@ -1,8 +0,0 @@
#pragma once
#include "DevMgr.hpp"
#include <functional>
std::function<int(unsigned int &, const char **)> stub_getNextDeviceName_callback = [](unsigned int &,
const char **) {return 0;};
@@ -1,11 +0,0 @@
#include "stub_parameter.h"
extern "C" {
/* This function blocks forever in tests, so override it with a version that can be customized */
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
return stub_pthread_cond_wait_callback(cond, mutex);
}
}
@@ -1,8 +0,0 @@
#pragma once
#include <pthread.h>
#include <functional>
std::function<int(pthread_cond_t *, pthread_mutex_t *)> stub_pthread_cond_wait_callback =
[](pthread_cond_t *, pthread_mutex_t *) {return 0;};