Merge changes I0699ed67,I58293973,I9c795dcb,I0b731d10,Ia2097345 am: 3acc7dc1f8 am: 2c20415ee8

Change-Id: I60dd6fec788ceb7aca4fe984c9a6dbfd691b2350
This commit is contained in:
Treehugger Robot 2020-03-27 21:32:59 +00:00 committed by Automerger Merge Worker
commit 15bef9ea30
12 changed files with 52 additions and 4 deletions

View file

@ -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));

View file

@ -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) \

View file

@ -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

View file

@ -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));

View file

@ -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) \

View file

@ -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

View file

@ -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));

View file

@ -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) \

View file

@ -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();

View file

@ -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));

View file

@ -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) \

View file

@ -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();