summaryrefslogtreecommitdiff
path: root/test/app_test.py
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2021-10-25 13:55:01 -0700
committerYabin Cui <yabinc@google.com>2021-10-25 15:16:15 -0700
commitfd4adaebfb7a69b8233b9029244f8e2e0c4e6930 (patch)
tree8744b86ae9e23f5a9e73886e396e58bf7cec0202 /test/app_test.py
parent6a1c9b850a2bca20dde09421c078762a4c93af98 (diff)
downloadsimpleperf-fd4adaebfb7a69b8233b9029244f8e2e0c4e6930.tar.gz
Update NDK prebuilts to build 7848450.
Taken from branch aosp-simpleperf-release. Bug: none Test: run test/test.py on android N-S for emulators and devices. Change-Id: I2e067890c4d6b7b45a72b9095ba325a37a110c89
Diffstat (limited to 'test/app_test.py')
-rw-r--r--test/app_test.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/app_test.py b/test/app_test.py
index c3a152b..146c140 100644
--- a/test/app_test.py
+++ b/test/app_test.py
@@ -14,10 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import glob
import os
+from pathlib import Path
import re
import shutil
import subprocess
+import time
from simpleperf_utils import remove
from . test_utils import TestBase, TestHelper, AdbHelper, INFERNO_SCRIPT
@@ -30,12 +33,12 @@ class TestExampleBase(TestBase):
cls.example_path = TestHelper.testdata_path(example_name)
if not os.path.isdir(cls.example_path):
log_fatal("can't find " + cls.example_path)
- for root, _, files in os.walk(cls.example_path):
- if 'app-profiling.apk' in files:
- cls.apk_path = os.path.join(root, 'app-profiling.apk')
- break
- if not hasattr(cls, 'apk_path'):
- log_fatal("can't find app-profiling.apk under " + cls.example_path)
+ apk_files = list(Path(cls.example_path).glob('**/app-profiling.apk'))
+ if not apk_files:
+ apk_files = list(Path(cls.example_path).glob('**/app-debug.apk'))
+ if not apk_files:
+ log_fatal("can't find apk under " + cls.example_path)
+ cls.apk_path = apk_files[0]
cls.package_name = package_name
cls.activity_name = activity_name
args = ["install", "-r"]
@@ -173,7 +176,7 @@ class TestExampleBase(TestBase):
def common_test_report_sample(self, check_strings):
self.run_cmd(["report_sample.py", "-h"])
self.run_cmd(["report_sample.py"])
- output = self.run_cmd(["report_sample.py", "perf.data"], return_output=True)
+ output = self.run_cmd(["report_sample.py", "-i", "perf.data"], return_output=True)
self.check_strings_in_content(output, check_strings)
def common_test_pprof_proto_generator(self, check_strings_with_lines,