Support `atest update_engine_unittests`.
We need a few changes to the building rules to support running the test
with atest. In particular, we need a customized test config to filter
out the helper executables. The change doesn't affect the traditionally
way of running tests with `adb sync data` + `adb shell
/d/n/u/update_engine_unittests`.
This is one of the prerequisites to run update_engine_unittests with
TEST_MAPPING [1]. It still requires additional works to enable the test
in pre/post-submit though (currently it's failing on GCE devices due to
missing shared libraries).
[1] https://source.android.com/compatibility/tests/development/test-mapping
Fixes: 131438455
Test: `atest update_engine_unittests` on blueline.
Test: TreeHugger; check that the existing GCL config'd test keeps working.
Change-Id: If602d69d84e0d926c579324d988c94b57240b113
diff --git a/test_config.xml b/test_config.xml
new file mode 100644
index 0000000..2639e7f
--- /dev/null
+++ b/test_config.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+<configuration description="Config to run update_engine_unittests on device">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-native" />
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="update_engine_unittests->/data/local/tmp/update_engine_unittests" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <!-- The following rules avoid test runner from calling the following helper executables
+ directly as gtests. -->
+ <option name="file-exclusion-filter-regex" value=".*/delta_generator$" />
+ <option name="file-exclusion-filter-regex" value=".*/test_http_server$" />
+ <option name="file-exclusion-filter-regex" value=".*/test_subprocess$" />
+ <option name="module-name" value="update_engine_unittests" />
+ </test>
+</configuration>