blob: 273d1ec66a70315917d9dc7711305a2c91565a98 [file] [log] [blame]
Slava Shklyaev73ee79d2019-05-14 14:15:14 +01001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_HARDWARE_NEURALNETWORKS_V1_1_GENERATED_TEST_HARNESS_H
18#define ANDROID_HARDWARE_NEURALNETWORKS_V1_1_GENERATED_TEST_HARNESS_H
19
20#include <android/hardware/neuralnetworks/1.1/IDevice.h>
Slava Shklyaev73ee79d2019-05-14 14:15:14 +010021#include "TestHarness.h"
Xusong Wangbcaa7822019-08-23 16:10:54 -070022#include "VtsHalNeuralnetworks.h"
Slava Shklyaev73ee79d2019-05-14 14:15:14 +010023
Michael Butler62749b92019-08-26 23:55:47 -070024namespace android::hardware::neuralnetworks::V1_1::vts::functional {
Xusong Wangbcaa7822019-08-23 16:10:54 -070025
26class GeneratedTestBase
27 : public NeuralnetworksHidlTest,
Michael Butler13b05162019-08-29 22:17:24 -070028 public testing::WithParamInterface<test_helper::TestModelManager::TestParam> {
Xusong Wangbcaa7822019-08-23 16:10:54 -070029 protected:
Michael Butler13b05162019-08-29 22:17:24 -070030 const test_helper::TestModel& kTestModel = *GetParam().second;
Xusong Wangbcaa7822019-08-23 16:10:54 -070031};
32
Michael Butler13b05162019-08-29 22:17:24 -070033#define INSTANTIATE_GENERATED_TEST(TestSuite, filter) \
34 INSTANTIATE_TEST_SUITE_P( \
35 TestGenerated, TestSuite, \
36 testing::ValuesIn(::test_helper::TestModelManager::get().getTestModels(filter)), \
Xusong Wangbcaa7822019-08-23 16:10:54 -070037 [](const auto& info) { return info.param.first; })
38
39// Tag for the validation tests, instantiated in VtsHalNeuralnetworks.cpp.
40// TODO: Clean up the hierarchy for ValidationTest.
Michael Butler13b05162019-08-29 22:17:24 -070041class ValidationTest : public GeneratedTestBase {};
Slava Shklyaev73ee79d2019-05-14 14:15:14 +010042
Xusong Wang81611962019-08-09 16:41:16 -070043Model createModel(const ::test_helper::TestModel& testModel);
44
Michael Butler62749b92019-08-26 23:55:47 -070045} // namespace android::hardware::neuralnetworks::V1_1::vts::functional
Slava Shklyaev73ee79d2019-05-14 14:15:14 +010046
47#endif // ANDROID_HARDWARE_NEURALNETWORKS_V1_1_GENERATED_TEST_HARNESS_H