Merge changes I0699ed67,I58293973,I9c795dcb,I0b731d10,Ia2097345 am: 3acc7dc1f8
am: 2c20415ee8
Change-Id: I60dd6fec788ceb7aca4fe984c9a6dbfd691b2350
This commit is contained in:
commit
15bef9ea30
12 changed files with 52 additions and 4 deletions
|
@ -160,6 +160,10 @@ std::vector<NamedModel> getNamedModels(const FilterFn& filter) {
|
|||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter) {
|
||||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info) {
|
||||
const auto& [namedDevice, namedModel] = info.param;
|
||||
return gtestCompliantName(getName(namedDevice) + "_" + getName(namedModel));
|
||||
|
|
|
@ -37,6 +37,9 @@ class GeneratedTestBase : public testing::TestWithParam<GeneratedTestParam> {
|
|||
using FilterFn = std::function<bool(const test_helper::TestModel&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterFn& filter);
|
||||
|
||||
using FilterNameFn = std::function<bool(const std::string&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter);
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info);
|
||||
|
||||
#define INSTANTIATE_GENERATED_TEST(TestSuite, filter) \
|
||||
|
|
|
@ -135,6 +135,11 @@ TEST_P(ValidationTest, Test) {
|
|||
validateEverything(kDevice, model, request);
|
||||
}
|
||||
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const test_helper::TestModel&) { return true; });
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const std::string& testName) {
|
||||
// Skip validation for the "inputs_as_internal" and "all_tensors_as_inputs"
|
||||
// generated tests.
|
||||
return testName.find("inputs_as_internal") == std::string::npos &&
|
||||
testName.find("all_tensors_as_inputs") == std::string::npos;
|
||||
});
|
||||
|
||||
} // namespace android::hardware::neuralnetworks::V1_0::vts::functional
|
||||
|
|
|
@ -168,6 +168,10 @@ std::vector<NamedModel> getNamedModels(const FilterFn& filter) {
|
|||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter) {
|
||||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info) {
|
||||
const auto& [namedDevice, namedModel] = info.param;
|
||||
return gtestCompliantName(getName(namedDevice) + "_" + getName(namedModel));
|
||||
|
|
|
@ -37,6 +37,9 @@ class GeneratedTestBase : public testing::TestWithParam<GeneratedTestParam> {
|
|||
using FilterFn = std::function<bool(const test_helper::TestModel&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterFn& filter);
|
||||
|
||||
using FilterNameFn = std::function<bool(const std::string&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter);
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info);
|
||||
|
||||
#define INSTANTIATE_GENERATED_TEST(TestSuite, filter) \
|
||||
|
|
|
@ -138,6 +138,11 @@ TEST_P(ValidationTest, Test) {
|
|||
validateEverything(kDevice, model, request);
|
||||
}
|
||||
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const test_helper::TestModel&) { return true; });
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const std::string& testName) {
|
||||
// Skip validation for the "inputs_as_internal" and "all_tensors_as_inputs"
|
||||
// generated tests.
|
||||
return testName.find("inputs_as_internal") == std::string::npos &&
|
||||
testName.find("all_tensors_as_inputs") == std::string::npos;
|
||||
});
|
||||
|
||||
} // namespace android::hardware::neuralnetworks::V1_1::vts::functional
|
||||
|
|
|
@ -390,6 +390,10 @@ std::vector<NamedModel> getNamedModels(const FilterFn& filter) {
|
|||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter) {
|
||||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info) {
|
||||
const auto& [namedDevice, namedModel] = info.param;
|
||||
return gtestCompliantName(getName(namedDevice) + "_" + getName(namedModel));
|
||||
|
|
|
@ -41,6 +41,9 @@ class GeneratedTestBase : public testing::TestWithParam<GeneratedTestParam> {
|
|||
using FilterFn = std::function<bool(const test_helper::TestModel&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterFn& filter);
|
||||
|
||||
using FilterNameFn = std::function<bool(const std::string&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter);
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info);
|
||||
|
||||
#define INSTANTIATE_GENERATED_TEST(TestSuite, filter) \
|
||||
|
|
|
@ -162,7 +162,12 @@ TEST_P(ValidationTest, Test) {
|
|||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const test_helper::TestModel&) { return true; });
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const std::string& testName) {
|
||||
// Skip validation for the "inputs_as_internal" and "all_tensors_as_inputs"
|
||||
// generated tests.
|
||||
return testName.find("inputs_as_internal") == std::string::npos &&
|
||||
testName.find("all_tensors_as_inputs") == std::string::npos;
|
||||
});
|
||||
|
||||
sp<IPreparedModel> getPreparedModel_1_2(const sp<implementation::PreparedModelCallback>& callback) {
|
||||
sp<V1_0::IPreparedModel> preparedModelV1_0 = callback->getPreparedModel();
|
||||
|
|
|
@ -916,6 +916,10 @@ std::vector<NamedModel> getNamedModels(const FilterFn& filter) {
|
|||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter) {
|
||||
return TestModelManager::get().getTestModels(filter);
|
||||
}
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info) {
|
||||
const auto& [namedDevice, namedModel] = info.param;
|
||||
return gtestCompliantName(getName(namedDevice) + "_" + getName(namedModel));
|
||||
|
|
|
@ -41,6 +41,9 @@ class GeneratedTestBase : public testing::TestWithParam<GeneratedTestParam> {
|
|||
using FilterFn = std::function<bool(const test_helper::TestModel&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterFn& filter);
|
||||
|
||||
using FilterNameFn = std::function<bool(const std::string&)>;
|
||||
std::vector<NamedModel> getNamedModels(const FilterNameFn& filter);
|
||||
|
||||
std::string printGeneratedTest(const testing::TestParamInfo<GeneratedTestParam>& info);
|
||||
|
||||
#define INSTANTIATE_GENERATED_TEST(TestSuite, filter) \
|
||||
|
|
|
@ -186,7 +186,12 @@ TEST_P(ValidationTest, Test) {
|
|||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const test_helper::TestModel&) { return true; });
|
||||
INSTANTIATE_GENERATED_TEST(ValidationTest, [](const std::string& testName) {
|
||||
// Skip validation for the "inputs_as_internal" and "all_tensors_as_inputs"
|
||||
// generated tests.
|
||||
return testName.find("inputs_as_internal") == std::string::npos &&
|
||||
testName.find("all_tensors_as_inputs") == std::string::npos;
|
||||
});
|
||||
|
||||
sp<IPreparedModel> getPreparedModel_1_3(const sp<PreparedModelCallback>& callback) {
|
||||
sp<V1_0::IPreparedModel> preparedModelV1_0 = callback->getPreparedModel();
|
||||
|
|
Loading…
Reference in a new issue