Run perfetto_integrationtests from /data/local/tests.

This way they get labeled as shell_test_data_file rather than
shell_data_file. That lets us grant more fine-grained SELinux
permissions that are restricted to tests.

Also, the plan is to make this the default path in the long run,
see https://android.googlesource.com/platform/build/soong/+/3b933d31657253e547caab38ef151c7d0e08856d/cc/test.go#349


Test: HEAPPROFD_TEST_PROFILE_OUT=/data/local/tmp ./perfetto_integrationtests/arm64/perfetto_integrationtests --gtest_filter='Run/HeapprofdEndToEnd.*'
      verify profile has proper symbols
Change-Id: I3fd590e8a0ea4b22720853ad24a0cd0f19f49353
diff --git a/Android.bp b/Android.bp
index ba70216..1dd3333 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1853,6 +1853,7 @@
   test_suites: [
     "general-tests",
   ],
+  test_config: "PerfettoIntegrationTests.xml",
 }
 
 // GN: //protos/perfetto/common:cpp
diff --git a/PerfettoIntegrationTests.xml b/PerfettoIntegrationTests.xml
new file mode 100644
index 0000000..97e7c3a
--- /dev/null
+++ b/PerfettoIntegrationTests.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 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="Runs perfetto_integrationtests.">
+    <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="perfetto_integrationtests->/data/local/tests/unrestricted/perfetto_integrationtests" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path"
+                value="/data/local/tests/unrestricted" />
+        <option name="module-name" value="perfetto_integrationtests" />
+    </test>
+</configuration>
\ No newline at end of file
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
index 8486de6..38c7cca 100755
--- a/tools/gen_android_bp
+++ b/tools/gen_android_bp
@@ -200,6 +200,7 @@
     ],
     'perfetto_integrationtests': [
       ('test_suites', {'general-tests'}),
+      ('test_config', 'PerfettoIntegrationTests.xml'),
     ],
     'traced_probes': [
         ('required', {'libperfetto_android_internal',
@@ -456,6 +457,7 @@
     self.genrule_shared_libs = set()
     self.version_script = None
     self.test_suites = set()
+    self.test_config = None
     self.stubs = {}
 
   def to_string(self, output):
@@ -488,6 +490,7 @@
     self._output_field(output, 'apex_available')
     self._output_field(output, 'version_script')
     self._output_field(output, 'test_suites')
+    self._output_field(output, 'test_config')
     self._output_field(output, 'stubs')
 
     target_out = []