Loading system/service/Android.mk +9 −5 Original line number Diff line number Diff line Loading @@ -81,30 +81,34 @@ include $(BUILD_EXECUTABLE) # Native system service unittests for host # ======================================================== ifeq ($(HOST_OS),linux) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(btserviceCommonSrc) \ $(btserviceLinuxSrc) \ hal/fake_bluetooth_gatt_interface.cpp \ hal/fake_bluetooth_interface.cpp \ test/adapter_unittest.cpp \ test/advertise_data_unittest.cpp \ test/fake_hal_util.cpp \ test/ipc_linux_unittest.cpp \ test/low_energy_client_unittest.cpp \ test/settings_unittest.cpp \ test/stub_ipc_handler_binder.cpp \ test/uuid_unittest.cpp ifeq ($(HOST_OS),linux) LOCAL_SRC_FILES += \ $(btserviceLinuxSrc) \ test/ipc_linux_unittest.cpp LOCAL_LDLIBS += -lrt else LOCAL_SRC_FILES += \ test/stub_ipc_handler_linux.cpp endif LOCAL_C_INCLUDES += $(btserviceCommonIncludes) LOCAL_CFLAGS += -std=c++11 LOCAL_LDLIBS += -lrt LOCAL_MODULE_TAGS := tests LOCAL_MODULE := bt_service_unittests LOCAL_SHARED_LIBRARIES += libchrome-host LOCAL_STATIC_LIBRARIES += libgmock_host liblog include $(BUILD_HOST_NATIVE_TEST) endif # Native system service unittests for Binder code, for target # ======================================================== Loading system/service/test/stub_ipc_handler_linux.cpp 0 → 100644 +72 −0 Original line number Diff line number Diff line // // Copyright (C) 2015 Google, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #include "service/ipc/ipc_handler_linux.h" // TODO(keybuk): This is a crappy workaround to link IPCHandlerLinux into // host-native unit tests. IPCManager shouldn't explicitly reference these // classes. namespace ipc { IPCHandlerLinux::IPCHandlerLinux( bluetooth::Adapter* adapter, IPCManager::Delegate* delegate) : IPCHandler(adapter, delegate), running_(false), thread_("IPCHandlerLinux"), keep_running_(true) { // Stub } IPCHandlerLinux::~IPCHandlerLinux() { // Stub } bool IPCHandlerLinux::Run() { // Stub return false; } void IPCHandlerLinux::Stop() { // Stub } void IPCHandlerLinux::StartListeningOnThread() { // Stub } void IPCHandlerLinux::ShutDownOnOriginThread() { // Stub } void IPCHandlerLinux::NotifyStartedOnOriginThread() { // Stub } void IPCHandlerLinux::NotifyStartedOnCurrentThread() { // Stub } void IPCHandlerLinux::NotifyStoppedOnOriginThread() { // Stub } void IPCHandlerLinux::NotifyStoppedOnCurrentThread() { // Stub } } // namespace Loading
system/service/Android.mk +9 −5 Original line number Diff line number Diff line Loading @@ -81,30 +81,34 @@ include $(BUILD_EXECUTABLE) # Native system service unittests for host # ======================================================== ifeq ($(HOST_OS),linux) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(btserviceCommonSrc) \ $(btserviceLinuxSrc) \ hal/fake_bluetooth_gatt_interface.cpp \ hal/fake_bluetooth_interface.cpp \ test/adapter_unittest.cpp \ test/advertise_data_unittest.cpp \ test/fake_hal_util.cpp \ test/ipc_linux_unittest.cpp \ test/low_energy_client_unittest.cpp \ test/settings_unittest.cpp \ test/stub_ipc_handler_binder.cpp \ test/uuid_unittest.cpp ifeq ($(HOST_OS),linux) LOCAL_SRC_FILES += \ $(btserviceLinuxSrc) \ test/ipc_linux_unittest.cpp LOCAL_LDLIBS += -lrt else LOCAL_SRC_FILES += \ test/stub_ipc_handler_linux.cpp endif LOCAL_C_INCLUDES += $(btserviceCommonIncludes) LOCAL_CFLAGS += -std=c++11 LOCAL_LDLIBS += -lrt LOCAL_MODULE_TAGS := tests LOCAL_MODULE := bt_service_unittests LOCAL_SHARED_LIBRARIES += libchrome-host LOCAL_STATIC_LIBRARIES += libgmock_host liblog include $(BUILD_HOST_NATIVE_TEST) endif # Native system service unittests for Binder code, for target # ======================================================== Loading
system/service/test/stub_ipc_handler_linux.cpp 0 → 100644 +72 −0 Original line number Diff line number Diff line // // Copyright (C) 2015 Google, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #include "service/ipc/ipc_handler_linux.h" // TODO(keybuk): This is a crappy workaround to link IPCHandlerLinux into // host-native unit tests. IPCManager shouldn't explicitly reference these // classes. namespace ipc { IPCHandlerLinux::IPCHandlerLinux( bluetooth::Adapter* adapter, IPCManager::Delegate* delegate) : IPCHandler(adapter, delegate), running_(false), thread_("IPCHandlerLinux"), keep_running_(true) { // Stub } IPCHandlerLinux::~IPCHandlerLinux() { // Stub } bool IPCHandlerLinux::Run() { // Stub return false; } void IPCHandlerLinux::Stop() { // Stub } void IPCHandlerLinux::StartListeningOnThread() { // Stub } void IPCHandlerLinux::ShutDownOnOriginThread() { // Stub } void IPCHandlerLinux::NotifyStartedOnOriginThread() { // Stub } void IPCHandlerLinux::NotifyStartedOnCurrentThread() { // Stub } void IPCHandlerLinux::NotifyStoppedOnOriginThread() { // Stub } void IPCHandlerLinux::NotifyStoppedOnCurrentThread() { // Stub } } // namespace