Files
android_development/samples/AconfigDemo/tests/unittests/AconfigDemoUnitTests2.xml
Zhi Dou 3c4cc122eb Add demo code for testing
This change add demo for using test mode flag lib in
self-instrumentation tests.

There are two options.

The option 1 is to create two versions, prod and test, of the library
using flags. The prod version library uses prod flag lib, and the test
version library uses test flag lib.

The option 2 is to dynamically link to the flag lib in the library. The
flag lib is used as a stub lib and is just used for building purpose.
The in the finally binary which uses the library, the binary should
statically link to the right version of the flag lib.

Bug: 295561701
Test: atest AconfigDemoUnitTests1 && atest AconfigDemoUnitTests2

Change-Id: Ie571a260d9042933032c702095808dbf59d1697c
2023-08-18 19:45:14 +00:00

33 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- This test config file is auto-generated. -->
<configuration description="Runs AconfigDemoUnitTests2.">
<target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
<option name="run-command" value="pm uninstall com.example.android.aconfig.demo" />
<option name="run-command" value="pm uninstall com.example.android.aconfig.demo.tests" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="AconfigDemoUnitTests2.apk" />
<option name="test-file-name" value="AconfigDemoActivityTest2.apk" />
</target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.example.android.aconfig.demo.tests" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
</test>
</configuration>