Merge "Test for getHashChain() in IBase." into oc-dev

This commit is contained in:
TreeHugger Robot 2017-04-04 01:00:38 +00:00 committed by Android (Google) Code Review
commit b04aa8907a
7 changed files with 257 additions and 0 deletions

View file

@ -9,6 +9,8 @@ subdirs = [
"foo/1.0",
"foo/1.0/default",
"foo/1.0/default/lib",
"hash/1.0",
"hash/1.0/default",
"inheritance/1.0",
"inheritance/1.0/default",
"libhwbinder/1.0",

59
tests/hash/1.0/Android.bp Normal file
View file

@ -0,0 +1,59 @@
// This file is autogenerated by hidl-gen. Do not edit manually.
filegroup {
name: "android.hardware.tests.hash@1.0_hal",
srcs: [
"IHash.hal",
],
}
genrule {
name: "android.hardware.tests.hash@1.0_genc++",
tools: ["hidl-gen"],
cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.hash@1.0",
srcs: [
":android.hardware.tests.hash@1.0_hal",
],
out: [
"android/hardware/tests/hash/1.0/HashAll.cpp",
],
}
genrule {
name: "android.hardware.tests.hash@1.0_genc++_headers",
tools: ["hidl-gen"],
cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.hash@1.0",
srcs: [
":android.hardware.tests.hash@1.0_hal",
],
out: [
"android/hardware/tests/hash/1.0/IHash.h",
"android/hardware/tests/hash/1.0/IHwHash.h",
"android/hardware/tests/hash/1.0/BnHwHash.h",
"android/hardware/tests/hash/1.0/BpHwHash.h",
"android/hardware/tests/hash/1.0/BsHash.h",
],
}
cc_library_shared {
name: "android.hardware.tests.hash@1.0",
generated_sources: ["android.hardware.tests.hash@1.0_genc++"],
generated_headers: ["android.hardware.tests.hash@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.hash@1.0_genc++_headers"],
shared_libs: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"liblog",
"libutils",
"libcutils",
"android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
"android.hidl.base@1.0",
],
}

76
tests/hash/1.0/Android.mk Normal file
View file

@ -0,0 +1,76 @@
# This file is autogenerated by hidl-gen. Do not edit manually.
LOCAL_PATH := $(call my-dir)
################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.tests.hash@1.0-java
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
intermediates := $(call local-generated-sources-dir, COMMON)
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
LOCAL_JAVA_LIBRARIES := \
android.hidl.base@1.0-java \
#
# Build IHash.hal
#
GEN := $(intermediates)/android/hardware/tests/hash/V1_0/IHash.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IHash.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.tests.hash@1.0::IHash
$(GEN): $(LOCAL_PATH)/IHash.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)
################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.tests.hash@1.0-java-static
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
intermediates := $(call local-generated-sources-dir, COMMON)
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
LOCAL_STATIC_JAVA_LIBRARIES := \
android.hidl.base@1.0-java-static \
#
# Build IHash.hal
#
GEN := $(intermediates)/android/hardware/tests/hash/V1_0/IHash.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IHash.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.tests.hash@1.0::IHash
$(GEN): $(LOCAL_PATH)/IHash.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))

32
tests/hash/1.0/IHash.hal Normal file
View file

@ -0,0 +1,32 @@
/*
* Copyright (C) 2017 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.
*/
package android.hardware.tests.hash@1.0;
/**
* Test interface for hashing HAL files.
* This file is FREEZED to ensure its hash doesn't change.
*/
interface IHash {
/**
* Dummy.
*/
dummy();
/**
* Dummy.
*/
functions();
};

View file

@ -0,0 +1,15 @@
cc_library_shared {
name: "android.hardware.tests.hash@1.0-impl",
relative_install_path: "hw",
proprietary: true,
srcs: [
"Hash.cpp",
],
shared_libs: [
"libhidlbase",
"libhidltransport",
"libutils",
"android.hardware.tests.hash@1.0",
"android.hidl.base@1.0",
],
}

View file

@ -0,0 +1,30 @@
#include "Hash.h"
namespace android {
namespace hardware {
namespace tests {
namespace hash {
namespace V1_0 {
namespace implementation {
// Methods from ::android::hardware::tests::hash::V1_0::IHash follow.
Return<void> Hash::dummy() {
return Void();
}
Return<void> Hash::functions() {
return Void();
}
// Methods from ::android::hidl::base::V1_0::IBase follow.
IHash* HIDL_FETCH_IHash(const char* /* name */) {
return new Hash();
}
} // namespace implementation
} // namespace V1_0
} // namespace hash
} // namespace tests
} // namespace hardware
} // namespace android

View file

@ -0,0 +1,43 @@
#ifndef ANDROID_HARDWARE_TESTS_HASH_V1_0_HASH_H
#define ANDROID_HARDWARE_TESTS_HASH_V1_0_HASH_H
#include <android/hardware/tests/hash/1.0/IHash.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace tests {
namespace hash {
namespace V1_0 {
namespace implementation {
using ::android::hardware::tests::hash::V1_0::IHash;
using ::android::hidl::base::V1_0::DebugInfo;
using ::android::hidl::base::V1_0::IBase;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
struct Hash : public IHash {
// Methods from ::android::hardware::tests::hash::V1_0::IHash follow.
Return<void> dummy() override;
Return<void> functions() override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
};
extern "C" IHash* HIDL_FETCH_IHash(const char* name);
} // namespace implementation
} // namespace V1_0
} // namespace hash
} // namespace tests
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_TESTS_HASH_V1_0_HASH_H