Loading tv/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -2,4 +2,5 @@ subdirs = [ "cec/1.0", "input/1.0", "input/1.0/vts/functional", ] tv/input/1.0/vts/functional/Android.bp 0 → 100644 +43 −0 Original line number Diff line number Diff line // // 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. // cc_test { name: "tv_input_hidl_hal_test", gtest: true, srcs: ["tv_input_hidl_hal_test.cpp"], shared_libs: [ "libbase", "liblog", "libcutils", "libhidlbase", "libhidltransport", "libhwbinder", "libnativehelper", "libutils", "android.hardware.tv.input@1.0", ], static_libs: ["libgtest"], cflags: [ // TODO: add --coverage when the segfault issue is fixed. // "--coverage", "-O0", "-g", ], // ldflags: [ // "--coverage" // ] } tv/input/1.0/vts/functional/tv_input_hidl_hal_test.cpp 0 → 100644 +94 −0 Original line number Diff line number Diff line /* * 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. */ #define LOG_TAG "tv_input_hidl_hal_test" #include <android-base/logging.h> #include <android/hardware/tv/input/1.0/types.h> #include <android/hardware/tv/input/1.0/ITvInput.h> #include <android/hardware/tv/input/1.0/ITvInputCallback.h> #include <gtest/gtest.h> using ::android::hardware::tv::input::V1_0::ITvInput; using ::android::hardware::tv::input::V1_0::ITvInputCallback; using ::android::hardware::tv::input::V1_0::Result; using ::android::hardware::tv::input::V1_0::TvInputType; using ::android::hardware::tv::input::V1_0::TvInputDeviceInfo; using ::android::hardware::tv::input::V1_0::TvInputEventType; using ::android::hardware::tv::input::V1_0::TvInputEvent; using ::android::hardware::tv::input::V1_0::TvStreamConfig; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; // Simple ITvInputCallback used as part of testing. class TvInputCallback : public ITvInputCallback { public: TvInputCallback() {}; virtual ~TvInputCallback() = default; // notify callback function - currently no-op. // TODO: modify it later. Return<void> notify(const TvInputEvent& event) override { return Void(); }; }; // The main test class for TV Input HIDL HAL. class TvInputHidlTest : public ::testing::Test { public: virtual void SetUp() override { // currently test passthrough mode only tv_input = ITvInput::getService(); ASSERT_NE(tv_input, nullptr); tv_input_callback = new TvInputCallback(); ASSERT_NE(tv_input_callback, nullptr); } virtual void TearDown() override {} sp<ITvInput> tv_input; sp<ITvInputCallback> tv_input_callback; }; // A class for test environment setup. class TvInputHidlEnvironment : public ::testing::Environment { public: virtual void SetUp() {} virtual void TearDown() {} private: }; // TODO: remove this test and add meaningful tests. TEST_F(TvInputHidlTest, DummyTest) { EXPECT_NE(tv_input, nullptr); } int main(int argc, char **argv) { ::testing::AddGlobalTestEnvironment(new TvInputHidlEnvironment); ::testing::InitGoogleTest(&argc, argv); int status = RUN_ALL_TESTS(); ALOGI("Test result = %d", status); return status; } tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/target/Android.mk 0 → 100644 +26 −0 Original line number Diff line number Diff line # # 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. # LOCAL_PATH := $(call my-dir) include $(call all-subdir-makefiles) include $(CLEAR_VARS) LOCAL_MODULE := HalTvInputHidlTargetTest VTS_CONFIG_SRC_DIR := testcases/hal/tv_input/hidl/target include test/vts/tools/build/Android.host_config.mk tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/target/AndroidTest.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- 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. --> <configuration description="Config for VTS TV Input HIDL HAL's target-side test cases"> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher"> <option name="push-group" value="HidlHalTest.push" /> </target_preparer> <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" /> <test class="com.android.tradefed.testtype.VtsMultiDeviceTest"> <option name="test-module-name" value="HalTvInputHidlTargetTest"/> <option name="binary-test-sources" value=" _32bit::DATA/nativetest/tv_input_hidl_hal_test/tv_input_hidl_hal_test, "/> <option name="binary-test-type" value="gtest" /> <option name="test-timeout" value="1m" /> </test> </configuration> Loading
tv/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -2,4 +2,5 @@ subdirs = [ "cec/1.0", "input/1.0", "input/1.0/vts/functional", ]
tv/input/1.0/vts/functional/Android.bp 0 → 100644 +43 −0 Original line number Diff line number Diff line // // 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. // cc_test { name: "tv_input_hidl_hal_test", gtest: true, srcs: ["tv_input_hidl_hal_test.cpp"], shared_libs: [ "libbase", "liblog", "libcutils", "libhidlbase", "libhidltransport", "libhwbinder", "libnativehelper", "libutils", "android.hardware.tv.input@1.0", ], static_libs: ["libgtest"], cflags: [ // TODO: add --coverage when the segfault issue is fixed. // "--coverage", "-O0", "-g", ], // ldflags: [ // "--coverage" // ] }
tv/input/1.0/vts/functional/tv_input_hidl_hal_test.cpp 0 → 100644 +94 −0 Original line number Diff line number Diff line /* * 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. */ #define LOG_TAG "tv_input_hidl_hal_test" #include <android-base/logging.h> #include <android/hardware/tv/input/1.0/types.h> #include <android/hardware/tv/input/1.0/ITvInput.h> #include <android/hardware/tv/input/1.0/ITvInputCallback.h> #include <gtest/gtest.h> using ::android::hardware::tv::input::V1_0::ITvInput; using ::android::hardware::tv::input::V1_0::ITvInputCallback; using ::android::hardware::tv::input::V1_0::Result; using ::android::hardware::tv::input::V1_0::TvInputType; using ::android::hardware::tv::input::V1_0::TvInputDeviceInfo; using ::android::hardware::tv::input::V1_0::TvInputEventType; using ::android::hardware::tv::input::V1_0::TvInputEvent; using ::android::hardware::tv::input::V1_0::TvStreamConfig; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; // Simple ITvInputCallback used as part of testing. class TvInputCallback : public ITvInputCallback { public: TvInputCallback() {}; virtual ~TvInputCallback() = default; // notify callback function - currently no-op. // TODO: modify it later. Return<void> notify(const TvInputEvent& event) override { return Void(); }; }; // The main test class for TV Input HIDL HAL. class TvInputHidlTest : public ::testing::Test { public: virtual void SetUp() override { // currently test passthrough mode only tv_input = ITvInput::getService(); ASSERT_NE(tv_input, nullptr); tv_input_callback = new TvInputCallback(); ASSERT_NE(tv_input_callback, nullptr); } virtual void TearDown() override {} sp<ITvInput> tv_input; sp<ITvInputCallback> tv_input_callback; }; // A class for test environment setup. class TvInputHidlEnvironment : public ::testing::Environment { public: virtual void SetUp() {} virtual void TearDown() {} private: }; // TODO: remove this test and add meaningful tests. TEST_F(TvInputHidlTest, DummyTest) { EXPECT_NE(tv_input, nullptr); } int main(int argc, char **argv) { ::testing::AddGlobalTestEnvironment(new TvInputHidlEnvironment); ::testing::InitGoogleTest(&argc, argv); int status = RUN_ALL_TESTS(); ALOGI("Test result = %d", status); return status; }
tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/target/Android.mk 0 → 100644 +26 −0 Original line number Diff line number Diff line # # 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. # LOCAL_PATH := $(call my-dir) include $(call all-subdir-makefiles) include $(CLEAR_VARS) LOCAL_MODULE := HalTvInputHidlTargetTest VTS_CONFIG_SRC_DIR := testcases/hal/tv_input/hidl/target include test/vts/tools/build/Android.host_config.mk
tv/input/1.0/vts/functional/vts/testcases/hal/tv_input/hidl/target/AndroidTest.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- 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. --> <configuration description="Config for VTS TV Input HIDL HAL's target-side test cases"> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher"> <option name="push-group" value="HidlHalTest.push" /> </target_preparer> <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" /> <test class="com.android.tradefed.testtype.VtsMultiDeviceTest"> <option name="test-module-name" value="HalTvInputHidlTargetTest"/> <option name="binary-test-sources" value=" _32bit::DATA/nativetest/tv_input_hidl_hal_test/tv_input_hidl_hal_test, "/> <option name="binary-test-type" value="gtest" /> <option name="test-timeout" value="1m" /> </test> </configuration>