Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 1 | /* |
| 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 | #include "linkerconfig/baseconfig.h" |
| 18 | #include "configurationtest.h" |
| 19 | #include "linkerconfig/configwriter.h" |
| 20 | #include "mockenv.h" |
| 21 | |
Jooyung Han | 87e7df8 | 2020-02-03 14:23:06 +0900 | [diff] [blame] | 22 | using android::linkerconfig::contents::Context; |
| 23 | using android::linkerconfig::contents::CreateBaseConfiguration; |
| 24 | using android::linkerconfig::modules::ConfigWriter; |
| 25 | |
Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 26 | TEST(linkerconfig_configuration_fulltest, baseconfig_test) { |
| 27 | MockGenericVariables(); |
Jooyung Han | 87e7df8 | 2020-02-03 14:23:06 +0900 | [diff] [blame] | 28 | Context ctx; |
| 29 | auto base_config = CreateBaseConfiguration(ctx); |
| 30 | ConfigWriter config_writer; |
Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 31 | |
| 32 | base_config.WriteConfig(config_writer); |
| 33 | |
| 34 | VerifyConfiguration(config_writer.ToString()); |
| 35 | } |
| 36 | |
Kiyoung Kim | e655807 | 2019-09-30 16:58:39 +0900 | [diff] [blame] | 37 | TEST(linkerconfig_configuration_fulltest, |
| 38 | baseconfig_vndk_using_core_variant_test) { |
| 39 | MockGenericVariables(); |
| 40 | MockVndkUsingCoreVariant(); |
Jooyung Han | 87e7df8 | 2020-02-03 14:23:06 +0900 | [diff] [blame] | 41 | Context ctx; |
| 42 | auto base_config = CreateBaseConfiguration(ctx); |
| 43 | ConfigWriter config_writer; |
Kiyoung Kim | e655807 | 2019-09-30 16:58:39 +0900 | [diff] [blame] | 44 | |
| 45 | base_config.WriteConfig(config_writer); |
| 46 | |
| 47 | VerifyConfiguration(config_writer.ToString()); |
| 48 | } |
| 49 | |
Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 50 | TEST(linkerconfig_configuration_fulltest, baseconfig_vndk_27_test) { |
| 51 | MockGenericVariables(); |
| 52 | MockVndkVersion("27"); |
Jooyung Han | 87e7df8 | 2020-02-03 14:23:06 +0900 | [diff] [blame] | 53 | Context ctx; |
| 54 | auto base_config = CreateBaseConfiguration(ctx); |
| 55 | ConfigWriter config_writer; |
Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 56 | |
| 57 | base_config.WriteConfig(config_writer); |
| 58 | |
| 59 | VerifyConfiguration(config_writer.ToString()); |
Kiyoung Kim | e655807 | 2019-09-30 16:58:39 +0900 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | TEST(linkerconfig_configuration_fulltest, vndklite_test) { |
| 63 | MockGenericVariables(); |
| 64 | MockVnkdLite(); |
Jooyung Han | 87e7df8 | 2020-02-03 14:23:06 +0900 | [diff] [blame] | 65 | Context ctx; |
| 66 | auto vndklite_config = CreateBaseConfiguration(ctx); |
| 67 | ConfigWriter config_writer; |
Kiyoung Kim | e655807 | 2019-09-30 16:58:39 +0900 | [diff] [blame] | 68 | |
| 69 | vndklite_config.WriteConfig(config_writer); |
| 70 | |
| 71 | VerifyConfiguration(config_writer.ToString()); |
Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 72 | } |