blob: 5bd083120c4d43066baabbb6b6def9610f06bd88 [file] [log] [blame]
Shane Farmer74cdea32017-05-12 16:22:36 -07001/*
2 * Copyright (C) 2017 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 "configuration/ConfigurationParser.h"
18
19#include <string>
20
21#include <gmock/gmock.h>
22#include <gtest/gtest.h>
23
24#include "androidfw/ResourceTypes.h"
25
26#include "test/Test.h"
27#include "xml/XmlDom.h"
28
29namespace aapt {
30namespace {
31
32using android::ResTable_config;
33using configuration::Abi;
34using configuration::AndroidSdk;
Shane Farmer9f0e7f12017-06-22 12:26:44 -070035using configuration::Artifact;
Shane Farmer280be342017-06-21 15:20:15 -070036using configuration::PostProcessingConfiguration;
Shane Farmer74cdea32017-05-12 16:22:36 -070037using configuration::DeviceFeature;
38using configuration::GlTexture;
39using configuration::Locale;
40using configuration::AndroidManifest;
41using testing::ElementsAre;
42using xml::Element;
43using xml::NodeCast;
44
45constexpr const char* kValidConfig = R"(<?xml version="1.0" encoding="utf-8" ?>
46<post-process xmlns="http://schemas.android.com/tools/aapt">
47 <groups>
48 <abi-group label="arm">
49 <abi>armeabi-v7a</abi>
50 <abi>arm64-v8a</abi>
51 </abi-group>
52 <abi-group label="other">
53 <abi>x86</abi>
54 <abi>mips</abi>
55 </abi-group>
56 <screen-density-group label="large">
57 <screen-density>xhdpi</screen-density>
58 <screen-density>xxhdpi</screen-density>
59 <screen-density>xxxhdpi</screen-density>
60 </screen-density-group>
61 <screen-density-group label="alldpi">
62 <screen-density>ldpi</screen-density>
63 <screen-density>mdpi</screen-density>
64 <screen-density>hdpi</screen-density>
65 <screen-density>xhdpi</screen-density>
66 <screen-density>xxhdpi</screen-density>
67 <screen-density>xxxhdpi</screen-density>
68 </screen-density-group>
69 <locale-group label="europe">
Shane Farmer0a5b2012017-06-22 12:24:12 -070070 <locale>en</locale>
71 <locale>es</locale>
72 <locale>fr</locale>
73 <locale>de</locale>
Shane Farmer74cdea32017-05-12 16:22:36 -070074 </locale-group>
75 <locale-group label="north-america">
Shane Farmer0a5b2012017-06-22 12:24:12 -070076 <locale>en</locale>
77 <locale>es-rMX</locale>
78 <locale>fr-rCA</locale>
Shane Farmer74cdea32017-05-12 16:22:36 -070079 </locale-group>
80 <android-sdk-group label="19">
81 <android-sdk
82 minSdkVersion="19"
83 targetSdkVersion="24"
84 maxSdkVersion="25">
85 <manifest>
86 <!--- manifest additions here XSLT? TODO -->
87 </manifest>
88 </android-sdk>
89 </android-sdk-group>
90 <gl-texture-group label="dxt1">
91 <gl-texture name="GL_EXT_texture_compression_dxt1">
92 <texture-path>assets/dxt1/*</texture-path>
93 </gl-texture>
94 </gl-texture-group>
95 <device-feature-group label="low-latency">
96 <supports-feature>android.hardware.audio.low_latency</supports-feature>
97 </device-feature-group>
98 </groups>
99 <artifacts>
100 <artifact-format>
101 ${base}.${abi}.${screen-density}.${locale}.${sdk}.${gl}.${feature}.release
102 </artifact-format>
103 <artifact
104 name="art1"
105 abi-group="arm"
106 screen-density-group="large"
107 locale-group="europe"
108 android-sdk-group="19"
109 gl-texture-group="dxt1"
110 device-feature-group="low-latency"/>
111 <artifact
112 name="art2"
113 abi-group="other"
114 screen-density-group="alldpi"
115 locale-group="north-america"
116 android-sdk-group="19"
117 gl-texture-group="dxt1"
118 device-feature-group="low-latency"/>
119 </artifacts>
120</post-process>
121)";
122
123class ConfigurationParserTest : public ConfigurationParser, public ::testing::Test {
124 public:
125 ConfigurationParserTest() : ConfigurationParser("") {}
126
127 protected:
128 StdErrDiagnostics diag_;
129};
130
Shane Farmerb1027272017-06-14 09:10:28 -0700131TEST_F(ConfigurationParserTest, ForPath_NoFile) {
132 auto result = ConfigurationParser::ForPath("./does_not_exist.xml");
133 EXPECT_FALSE(result);
134}
135
Shane Farmer74cdea32017-05-12 16:22:36 -0700136TEST_F(ConfigurationParserTest, ValidateFile) {
137 auto parser = ConfigurationParser::ForContents(kValidConfig).WithDiagnostics(&diag_);
138 auto result = parser.Parse();
139 ASSERT_TRUE(result);
Shane Farmer280be342017-06-21 15:20:15 -0700140 PostProcessingConfiguration& value = result.value();
Shane Farmer74cdea32017-05-12 16:22:36 -0700141 EXPECT_EQ(2ul, value.artifacts.size());
142 ASSERT_TRUE(value.artifact_format);
143 EXPECT_EQ(
144 "${base}.${abi}.${screen-density}.${locale}.${sdk}.${gl}.${feature}.release",
145 value.artifact_format.value()
146 );
147
148 EXPECT_EQ(2ul, value.abi_groups.size());
149 EXPECT_EQ(2ul, value.abi_groups["arm"].size());
150 EXPECT_EQ(2ul, value.abi_groups["other"].size());
151
152 EXPECT_EQ(2ul, value.screen_density_groups.size());
153 EXPECT_EQ(3ul, value.screen_density_groups["large"].size());
154 EXPECT_EQ(6ul, value.screen_density_groups["alldpi"].size());
155
Shane Farmer0a5b2012017-06-22 12:24:12 -0700156 EXPECT_EQ(2ul, value.locale_groups.size());
Shane Farmer74cdea32017-05-12 16:22:36 -0700157 EXPECT_EQ(4ul, value.locale_groups["europe"].size());
158 EXPECT_EQ(3ul, value.locale_groups["north-america"].size());
Shane Farmer74cdea32017-05-12 16:22:36 -0700159
160 EXPECT_EQ(1ul, value.android_sdk_groups.size());
161 EXPECT_EQ(1ul, value.android_sdk_groups["19"].size());
162
163 EXPECT_EQ(1ul, value.gl_texture_groups.size());
164 EXPECT_EQ(1ul, value.gl_texture_groups["dxt1"].size());
165
166 EXPECT_EQ(1ul, value.device_feature_groups.size());
167 EXPECT_EQ(1ul, value.device_feature_groups["low-latency"].size());
168}
169
170TEST_F(ConfigurationParserTest, InvalidNamespace) {
171 constexpr const char* invalid_ns = R"(<?xml version="1.0" encoding="utf-8" ?>
172 <post-process xmlns="http://schemas.android.com/tools/another-unknown-tool" />)";
173
174 auto result = ConfigurationParser::ForContents(invalid_ns).Parse();
175 ASSERT_FALSE(result);
176}
177
178TEST_F(ConfigurationParserTest, ArtifactAction) {
179 static constexpr const char* xml = R"xml(
180 <artifact
181 abi-group="arm"
182 screen-density-group="large"
183 locale-group="europe"
184 android-sdk-group="19"
185 gl-texture-group="dxt1"
186 device-feature-group="low-latency"/>)xml";
187
188 auto doc = test::BuildXmlDom(xml);
189
Shane Farmer280be342017-06-21 15:20:15 -0700190 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700191 bool ok = artifact_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
192 ASSERT_TRUE(ok);
193
194 EXPECT_EQ(1ul, config.artifacts.size());
195
Shane Farmer57669432017-06-19 12:52:04 -0700196 auto& artifact = config.artifacts.front();
Shane Farmer0a5b2012017-06-22 12:24:12 -0700197 EXPECT_FALSE(artifact.name); // TODO: make this fail.
Shane Farmer74cdea32017-05-12 16:22:36 -0700198 EXPECT_EQ("arm", artifact.abi_group.value());
199 EXPECT_EQ("large", artifact.screen_density_group.value());
200 EXPECT_EQ("europe", artifact.locale_group.value());
201 EXPECT_EQ("19", artifact.android_sdk_group.value());
202 EXPECT_EQ("dxt1", artifact.gl_texture_group.value());
203 EXPECT_EQ("low-latency", artifact.device_feature_group.value());
Shane Farmer57669432017-06-19 12:52:04 -0700204
205 // Perform a second action to ensure we get 2 artifacts.
206 static constexpr const char* second = R"xml(
207 <artifact
208 abi-group="other"
209 screen-density-group="large"
210 locale-group="europe"
211 android-sdk-group="19"
212 gl-texture-group="dxt1"
213 device-feature-group="low-latency"/>)xml";
214 doc = test::BuildXmlDom(second);
215
216 ok = artifact_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
217 ASSERT_TRUE(ok);
218 EXPECT_EQ(2ul, config.artifacts.size());
Shane Farmer74cdea32017-05-12 16:22:36 -0700219}
220
221TEST_F(ConfigurationParserTest, ArtifactFormatAction) {
222 static constexpr const char* xml = R"xml(
223 <artifact-format>
224 ${base}.${abi}.${screen-density}.${locale}.${sdk}.${gl}.${feature}.release
225 </artifact-format>)xml";
226
227 auto doc = test::BuildXmlDom(xml);
228
Shane Farmer280be342017-06-21 15:20:15 -0700229 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700230 bool ok = artifact_format_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
231 ASSERT_TRUE(ok);
232 ASSERT_TRUE(config.artifact_format);
233 EXPECT_EQ(
234 "${base}.${abi}.${screen-density}.${locale}.${sdk}.${gl}.${feature}.release",
235 static_cast<std::string>(config.artifact_format.value())
236 );
237}
238
239TEST_F(ConfigurationParserTest, AbiGroupAction) {
240 static constexpr const char* xml = R"xml(
241 <abi-group label="arm">
242 <!-- First comment. -->
243 <abi>
244 armeabi-v7a
245 </abi>
246 <!-- Another comment. -->
247 <abi>arm64-v8a</abi>
248 </abi-group>)xml";
249
250 auto doc = test::BuildXmlDom(xml);
251
Shane Farmer280be342017-06-21 15:20:15 -0700252 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700253 bool ok = abi_group_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
254 ASSERT_TRUE(ok);
255
256 EXPECT_EQ(1ul, config.abi_groups.size());
257 ASSERT_EQ(1u, config.abi_groups.count("arm"));
258
259 auto& out = config.abi_groups["arm"];
260 ASSERT_THAT(out, ElementsAre(Abi::kArmV7a, Abi::kArm64V8a));
261}
262
263TEST_F(ConfigurationParserTest, ScreenDensityGroupAction) {
264 static constexpr const char* xml = R"xml(
265 <screen-density-group label="large">
266 <screen-density>xhdpi</screen-density>
267 <screen-density>
268 xxhdpi
269 </screen-density>
270 <screen-density>xxxhdpi</screen-density>
271 </screen-density-group>)xml";
272
273 auto doc = test::BuildXmlDom(xml);
274
Shane Farmer280be342017-06-21 15:20:15 -0700275 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700276 bool ok =
277 screen_density_group_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
278 ASSERT_TRUE(ok);
279
280 EXPECT_EQ(1ul, config.screen_density_groups.size());
281 ASSERT_EQ(1u, config.screen_density_groups.count("large"));
282
283 ConfigDescription xhdpi;
284 xhdpi.density = ResTable_config::DENSITY_XHIGH;
285 ConfigDescription xxhdpi;
286 xxhdpi.density = ResTable_config::DENSITY_XXHIGH;
287 ConfigDescription xxxhdpi;
288 xxxhdpi.density = ResTable_config::DENSITY_XXXHIGH;
289
290 auto& out = config.screen_density_groups["large"];
291 ASSERT_THAT(out, ElementsAre(xhdpi, xxhdpi, xxxhdpi));
292}
293
294TEST_F(ConfigurationParserTest, LocaleGroupAction) {
295 static constexpr const char* xml = R"xml(
296 <locale-group label="europe">
Shane Farmer0a5b2012017-06-22 12:24:12 -0700297 <locale>en</locale>
298 <locale>es</locale>
299 <locale>fr</locale>
300 <locale>de</locale>
Shane Farmer74cdea32017-05-12 16:22:36 -0700301 </locale-group>)xml";
302
303 auto doc = test::BuildXmlDom(xml);
304
Shane Farmer280be342017-06-21 15:20:15 -0700305 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700306 bool ok = locale_group_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
307 ASSERT_TRUE(ok);
308
309 ASSERT_EQ(1ul, config.locale_groups.size());
310 ASSERT_EQ(1u, config.locale_groups.count("europe"));
311
Shane Farmer0a5b2012017-06-22 12:24:12 -0700312 const auto& out = config.locale_groups["europe"];
Shane Farmer74cdea32017-05-12 16:22:36 -0700313
Shane Farmer0a5b2012017-06-22 12:24:12 -0700314 ConfigDescription en = test::ParseConfigOrDie("en");
315 ConfigDescription es = test::ParseConfigOrDie("es");
316 ConfigDescription fr = test::ParseConfigOrDie("fr");
317 ConfigDescription de = test::ParseConfigOrDie("de");
Shane Farmer74cdea32017-05-12 16:22:36 -0700318
319 ASSERT_THAT(out, ElementsAre(en, es, fr, de));
320}
321
322TEST_F(ConfigurationParserTest, AndroidSdkGroupAction) {
323 static constexpr const char* xml = R"xml(
324 <android-sdk-group label="19">
325 <android-sdk
326 minSdkVersion="19"
327 targetSdkVersion="24"
328 maxSdkVersion="25">
329 <manifest>
330 <!--- manifest additions here XSLT? TODO -->
331 </manifest>
332 </android-sdk>
333 </android-sdk-group>)xml";
334
335 auto doc = test::BuildXmlDom(xml);
336
Shane Farmer280be342017-06-21 15:20:15 -0700337 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700338 bool ok = android_sdk_group_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
339 ASSERT_TRUE(ok);
340
341 ASSERT_EQ(1ul, config.android_sdk_groups.size());
342 ASSERT_EQ(1u, config.android_sdk_groups.count("19"));
343
344 auto& out = config.android_sdk_groups["19"];
345
346 AndroidSdk sdk;
347 sdk.min_sdk_version = std::string("19");
348 sdk.target_sdk_version = std::string("24");
349 sdk.max_sdk_version = std::string("25");
350 sdk.manifest = AndroidManifest();
351
352 ASSERT_EQ(1ul, out.size());
353 ASSERT_EQ(sdk, out[0]);
354}
355
356TEST_F(ConfigurationParserTest, GlTextureGroupAction) {
357 static constexpr const char* xml = R"xml(
358 <gl-texture-group label="dxt1">
359 <gl-texture name="GL_EXT_texture_compression_dxt1">
360 <texture-path>assets/dxt1/main/*</texture-path>
361 <texture-path>
362 assets/dxt1/test/*
363 </texture-path>
364 </gl-texture>
365 </gl-texture-group>)xml";
366
367 auto doc = test::BuildXmlDom(xml);
368
Shane Farmer280be342017-06-21 15:20:15 -0700369 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700370 bool ok = gl_texture_group_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
371 ASSERT_TRUE(ok);
372
373 EXPECT_EQ(1ul, config.gl_texture_groups.size());
374 ASSERT_EQ(1u, config.gl_texture_groups.count("dxt1"));
375
376 auto& out = config.gl_texture_groups["dxt1"];
377
378 GlTexture texture{
379 std::string("GL_EXT_texture_compression_dxt1"),
380 {"assets/dxt1/main/*", "assets/dxt1/test/*"}
381 };
382
383 ASSERT_EQ(1ul, out.size());
384 ASSERT_EQ(texture, out[0]);
385}
386
387TEST_F(ConfigurationParserTest, DeviceFeatureGroupAction) {
388 static constexpr const char* xml = R"xml(
389 <device-feature-group label="low-latency">
390 <supports-feature>android.hardware.audio.low_latency</supports-feature>
391 <supports-feature>
392 android.hardware.audio.pro
393 </supports-feature>
394 </device-feature-group>)xml";
395
396 auto doc = test::BuildXmlDom(xml);
397
Shane Farmer280be342017-06-21 15:20:15 -0700398 PostProcessingConfiguration config;
Shane Farmer74cdea32017-05-12 16:22:36 -0700399 bool ok
400 = device_feature_group_handler_(&config, NodeCast<Element>(doc.get()->root.get()), &diag_);
401 ASSERT_TRUE(ok);
402
403 EXPECT_EQ(1ul, config.device_feature_groups.size());
404 ASSERT_EQ(1u, config.device_feature_groups.count("low-latency"));
405
406 auto& out = config.device_feature_groups["low-latency"];
407
408 DeviceFeature low_latency = "android.hardware.audio.low_latency";
409 DeviceFeature pro = "android.hardware.audio.pro";
410 ASSERT_THAT(out, ElementsAre(low_latency, pro));
411}
412
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700413// Artifact name parser test cases.
414
Shane Farmer9f0e7f12017-06-22 12:26:44 -0700415TEST(ArtifactTest, Simple) {
416 StdErrDiagnostics diag;
417 Artifact x86;
418 x86.abi_group = {"x86"};
419
Shane Farmer0a5b2012017-06-22 12:24:12 -0700420 auto x86_result = x86.ToArtifactName("something.${abi}.apk", &diag);
Shane Farmer9f0e7f12017-06-22 12:26:44 -0700421 ASSERT_TRUE(x86_result);
422 EXPECT_EQ(x86_result.value(), "something.x86.apk");
423
424 Artifact arm;
425 arm.abi_group = {"armeabi-v7a"};
426
Shane Farmer0a5b2012017-06-22 12:24:12 -0700427 auto arm_result = arm.ToArtifactName("app.${abi}.apk", &diag);
Shane Farmer9f0e7f12017-06-22 12:26:44 -0700428 ASSERT_TRUE(arm_result);
429 EXPECT_EQ(arm_result.value(), "app.armeabi-v7a.apk");
430}
431
432TEST(ArtifactTest, Complex) {
433 StdErrDiagnostics diag;
434 Artifact artifact;
435 artifact.abi_group = {"mips64"};
436 artifact.screen_density_group = {"ldpi"};
437 artifact.device_feature_group = {"df1"};
438 artifact.gl_texture_group = {"glx1"};
439 artifact.locale_group = {"en-AU"};
440 artifact.android_sdk_group = {"26"};
441
Shane Farmer0a5b2012017-06-22 12:24:12 -0700442 auto result = artifact.ToArtifactName(
443 "app.${density}_${locale}_${feature}_${gl}.sdk${sdk}.${abi}.apk", &diag);
Shane Farmer9f0e7f12017-06-22 12:26:44 -0700444 ASSERT_TRUE(result);
445 EXPECT_EQ(result.value(), "app.ldpi_en-AU_df1_glx1.sdk26.mips64.apk");
446}
447
448TEST(ArtifactTest, Missing) {
449 StdErrDiagnostics diag;
450 Artifact x86;
451 x86.abi_group = {"x86"};
452
Shane Farmer0a5b2012017-06-22 12:24:12 -0700453 EXPECT_FALSE(x86.ToArtifactName("something.${density}.apk", &diag));
Shane Farmer9f0e7f12017-06-22 12:26:44 -0700454 EXPECT_FALSE(x86.ToArtifactName("something.apk", &diag));
455}
456
457TEST(ArtifactTest, Empty) {
458 StdErrDiagnostics diag;
459 Artifact artifact;
460
Shane Farmer0a5b2012017-06-22 12:24:12 -0700461 EXPECT_FALSE(artifact.ToArtifactName("something.${density}.apk", &diag));
Shane Farmer9f0e7f12017-06-22 12:26:44 -0700462 EXPECT_TRUE(artifact.ToArtifactName("something.apk", &diag));
463}
464
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700465TEST(ArtifactTest, Repeated) {
466 StdErrDiagnostics diag;
467 Artifact artifact;
468 artifact.screen_density_group = {"mdpi"};
469
Shane Farmer0a5b2012017-06-22 12:24:12 -0700470 ASSERT_TRUE(artifact.ToArtifactName("something.${density}.apk", &diag));
471 EXPECT_FALSE(artifact.ToArtifactName("something.${density}.${density}.apk", &diag));
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700472}
473
474TEST(ArtifactTest, Nesting) {
475 StdErrDiagnostics diag;
476 Artifact x86;
477 x86.abi_group = {"x86"};
478
Shane Farmer0a5b2012017-06-22 12:24:12 -0700479 EXPECT_FALSE(x86.ToArtifactName("something.${abi${density}}.apk", &diag));
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700480
Shane Farmer0a5b2012017-06-22 12:24:12 -0700481 const Maybe<std::string>& name = x86.ToArtifactName("something.${abi${abi}}.apk", &diag);
482 ASSERT_TRUE(name);
483 EXPECT_EQ(name.value(), "something.${abix86}.apk");
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700484}
485
486TEST(ArtifactTest, Recursive) {
487 StdErrDiagnostics diag;
488 Artifact artifact;
Shane Farmer0a5b2012017-06-22 12:24:12 -0700489 artifact.device_feature_group = {"${gl}"};
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700490 artifact.gl_texture_group = {"glx1"};
491
Shane Farmer0a5b2012017-06-22 12:24:12 -0700492 EXPECT_FALSE(artifact.ToArtifactName("app.${feature}.${gl}.apk", &diag));
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700493
494 artifact.device_feature_group = {"df1"};
Shane Farmer0a5b2012017-06-22 12:24:12 -0700495 artifact.gl_texture_group = {"${feature}"};
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700496 {
Shane Farmer0a5b2012017-06-22 12:24:12 -0700497 const auto& result = artifact.ToArtifactName("app.${feature}.${gl}.apk", &diag);
498 ASSERT_TRUE(result);
499 EXPECT_EQ(result.value(), "app.df1.${feature}.apk");
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700500 }
501
502 // This is an invalid case, but should be the only possible case due to the ordering of
503 // replacement.
Shane Farmer0a5b2012017-06-22 12:24:12 -0700504 artifact.device_feature_group = {"${gl}"};
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700505 artifact.gl_texture_group = {"glx1"};
506 {
Shane Farmer0a5b2012017-06-22 12:24:12 -0700507 const auto& result = artifact.ToArtifactName("app.${feature}.apk", &diag);
508 ASSERT_TRUE(result);
Shane Farmer1a21b8c2017-07-21 09:42:42 -0700509 EXPECT_EQ(result.value(), "app.glx1.apk");
510 }
511}
512
Shane Farmer74cdea32017-05-12 16:22:36 -0700513} // namespace
514} // namespace aapt