I find myself using something like this every time I add functionality to init. I cannot possibly be the only one doing this. On the other hand, if this hasn't been added for so long, maybe there's a reason for that. The advantage of using a test service versus modifying an existing service is that the test service doesn't *require* any permissions or privileges, so you can add and/or remove whatever you need to test without breaking the service. I found it useful to have the service check its own /proc/<pid>/status from command-line arguments, so that's what the service does. This CL also adds a .clang-format file for init. Bug: None Test: Service runs and exits successfully. Change-Id: I3e7841a7283158e10c0bf55e0103c03902afb1f0
27 lines
905 B
Makefile
27 lines
905 B
Makefile
# Copyright (C) 2016 The Android Open Source Project
|
|
#
|
|
# 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.
|
|
|
|
LOCAL_PATH := $(call my-dir)
|
|
|
|
# Sample service for testing.
|
|
# =========================================================
|
|
include $(CLEAR_VARS)
|
|
LOCAL_MODULE := test_service
|
|
LOCAL_SRC_FILES := test_service.cpp
|
|
|
|
LOCAL_SHARED_LIBRARIES += libbase
|
|
|
|
LOCAL_INIT_RC := test_service.rc
|
|
|
|
include $(BUILD_EXECUTABLE)
|