Commit graph

10 commits

Author SHA1 Message Date
Michael Butler
e8e7a1018c Disable TEST_MAPPING for VtsHalNeuralnetworksV1_*TargetTest
A sibling change removes the NN HIDL sample drivers from cuttlefish. In
response, this change removes the VtsHalNeuralnetworksV1_*TargetTest
tests from the TEST_MAPPING because they do not test anything without
the NN HIDL sample drivers present.

Note that the NN AIDL sample drivers and NN AIDL VTS test
(VtsHalNeuralnetworksTargetTest) are still present.

Bug: 233665601
Test: mma
Test: croot && cd hardware/interfaces/neuralnetworks && atest
Change-Id: I90bccd843ba9296c27d3010cec652be55a13a225
2022-06-08 10:47:22 -07:00
Lev Proleev
900c28a250 Add canonical types adapters for NNAPI AIDL interface
Also:
* Add missing AIDL<->CT conversions
* Add AIDL-specific info to neuralnetworks/utils/README.md
* Add mock classes and tests AIDL adapters

Bug: 179015258
Test: neuralnetworks_utils_hal_test
Change-Id: Ifa98fadd46dca5dbf9b3ceb4da811aa8da45b6e4
Merged-In: Ifa98fadd46dca5dbf9b3ceb4da811aa8da45b6e4
(cherry picked from commit 3b93b0b56a)
2021-03-16 11:57:04 -07:00
Lev Proleev
81dbdb3196 Add VtsHalNeuralnetworksTargetTest to NNAPI test mapping
Bug: 172921927
Test: presubmit on cuttlefish
Change-Id: Ia59446246bef2a41912a6b0c9d11abd125e8d913
Merged-In: Ia59446246bef2a41912a6b0c9d11abd125e8d913
(cherry picked from commit 3665d245ad)
2021-03-02 17:40:39 +00:00
Michael Butler
6e492a62e1 Create unit tests for NN interface utility code
This CL introduces unit tests to validate the V1_X::utils::Device,
*PreparedModel, and *Buffer adapter classes. It does so by mocking the
underlying HIDL interface in order to simulate a driver returning bad
data, HIDL transport failures, and service crashes.

Note that the purpose of these new tests is to validate the adapter
classes themselves, not the HIDL interfaces they use. For example,
because nn::IPreparedModel does not currently define a method for
configuring a burst execution, V1_[23]::utils::PreparedModel similarly
does not use hardware::neuralnetworks::V1_[23]::IPreparedModel's
configureExecutionBurst method.

This CL also introduces unit tests to validate the utils::Resilient*
adapter classes, and mocks DEAD_OBJECT failures to ensure that the
underyling object can be recovered appropriately.

Bug: 163801800
Test: mma
Test: atest neuralnetworks_utils_hal_common_test
Test: atest neuralnetworks_utils_hal_1_[0-3]_test
Change-Id: I2c79865bf666d3f4bf53061ff5090746403583e9
Merged-In: I2c79865bf666d3f4bf53061ff5090746403583e9
(cherry picked from commit afc4d7cfe7)
2021-01-08 12:07:43 -08:00
Dan Shi
8d643a458f Move VtsHalNeuralnetworksV1_2/3TargetTest to group presubmit-large
The test config takes longer than 15mins to run. Move it to a dedicated
group for running slow presubmit Test Mapping test.

Bug: 174654670
Test: none
Change-Id: I11574377ed28676475321c4c84feccf5b33f08c3
2020-12-03 12:10:46 -08:00
Michael Butler
c9c0d5bef9 Change NNAPI VTS TEST_MAPPING to restrict testing on sample drivers
Bug: N/A
Test: cd $TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: If06740718e7cfebbe92058779b19282913cd5fc7
2019-10-29 19:08:38 -07:00
Michael Butler
62b76902fb Add VtsHalNeuralnetworksV1_3TargetTest to TEST_MAPPING
Bug: N/A
Test: cd $TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: Ic903a45fbb6487f2b8b18dfd32d356c987a98b14
2019-10-29 19:08:27 -07:00
Michael Butler
3104464c7f Simplify NNAPI VTS TEST_MAPPING options
Bug: N/A
Test: cd $TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: I1eb0f25fe13c641cc661484021629ecd811ed984
2019-10-29 18:43:17 -07:00
Michael Butler
0763328464 Change NNAPI VTS to use TEST_P to iterate across all service instances
This CL removes a dependency on the VTS test runner by dynamically
discovering all NN HAL service instances in the gtest binary itself,
and runs through all service instances with parameterized tests.

This CL converts TEST_F cases to TEST_P cases, where the test parameter
is the name of the service instance. For existing TEST_P cases (such as
the generated test cases), the service instance name is made to be the
first test parameter.

This CL enables the NN VTS tests to be more portable, e.g., they can
run directly as a presubmit test.

Fixes: 124540002
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest (with sample-all)
Test: cd $ANDROID_BUILD_TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: I1e301d7c9f9342bb8f35a267bef180f510944b19
Merged-In: I1e301d7c9f9342bb8f35a267bef180f510944b19
(cherry picked from commit 7076f629b7)
2019-09-20 11:20:48 -07:00
Michael Butler
58caa831bd Add presubmit tests to NNAPI -- hardware/interfaces/neuralnetworks
This CL creates a new suite of tests to enable presubmit tests:
* PresubmitHalNeuralnetworksV1_0TargetTest
* PresubmitHalNeuralnetworksV1_1TargetTest
* PresubmitHalNeuralnetworksV1_2TargetTest

These tests are the same as the VTS tests, with the exception that they
will skip running all tests (but still pass) if the service cannot be
found and its name starts with "service-".

This change does not affect the existing NNAPI VTS tests.

Test: mma
Test: atest
Bug: 124040554
Change-Id: I36a38b66b21fd51d0ca381bb4e05a39266dd353f
(cherry picked from commit ed68233697)
2019-02-19 12:04:24 -08:00