1*70a7ec85SAndroid Build Coastguard Worker /*
2*70a7ec85SAndroid Build Coastguard Worker * Copyright (C) 2019 The Android Open Source Project
3*70a7ec85SAndroid Build Coastguard Worker *
4*70a7ec85SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*70a7ec85SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*70a7ec85SAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*70a7ec85SAndroid Build Coastguard Worker *
8*70a7ec85SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0
9*70a7ec85SAndroid Build Coastguard Worker *
10*70a7ec85SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*70a7ec85SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*70a7ec85SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*70a7ec85SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*70a7ec85SAndroid Build Coastguard Worker * limitations under the License.
15*70a7ec85SAndroid Build Coastguard Worker */
16*70a7ec85SAndroid Build Coastguard Worker
17*70a7ec85SAndroid Build Coastguard Worker #include <unistd.h>
18*70a7ec85SAndroid Build Coastguard Worker #include <string>
19*70a7ec85SAndroid Build Coastguard Worker
20*70a7ec85SAndroid Build Coastguard Worker #include <android-base/properties.h>
21*70a7ec85SAndroid Build Coastguard Worker #include "utility/ValidateXml.h"
22*70a7ec85SAndroid Build Coastguard Worker
TEST(CheckConfig,compatibilityMatrixValidation)23*70a7ec85SAndroid Build Coastguard Worker TEST(CheckConfig, compatibilityMatrixValidation) {
24*70a7ec85SAndroid Build Coastguard Worker if (android::base::GetIntProperty("ro.product.first_api_level", 0) <= 28) {
25*70a7ec85SAndroid Build Coastguard Worker GTEST_SKIP();
26*70a7ec85SAndroid Build Coastguard Worker }
27*70a7ec85SAndroid Build Coastguard Worker
28*70a7ec85SAndroid Build Coastguard Worker RecordProperty("description",
29*70a7ec85SAndroid Build Coastguard Worker "Verify that the compatibility matrix file "
30*70a7ec85SAndroid Build Coastguard Worker "is valid according to the schema");
31*70a7ec85SAndroid Build Coastguard Worker
32*70a7ec85SAndroid Build Coastguard Worker std::vector<const char*> locations = {"/vendor/etc/vintf"};
33*70a7ec85SAndroid Build Coastguard Worker EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS("compatibility_matrix.xml", locations,
34*70a7ec85SAndroid Build Coastguard Worker "/data/local/tmp/compatibility_matrix.xsd");
35*70a7ec85SAndroid Build Coastguard Worker }
36