diff options
Diffstat (limited to 'simpleperf/scripts/test/app_profiler_test.py')
-rw-r--r-- | simpleperf/scripts/test/app_profiler_test.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/simpleperf/scripts/test/app_profiler_test.py b/simpleperf/scripts/test/app_profiler_test.py index 9fc4bcc5..b6b39ba8 100644 --- a/simpleperf/scripts/test/app_profiler_test.py +++ b/simpleperf/scripts/test/app_profiler_test.py @@ -16,6 +16,8 @@ from app_profiler import NativeLibDownloader import shutil +import subprocess +import sys from simpleperf_utils import str_to_bytes, bytes_to_str, remove from . test_utils import TestBase, TestHelper, INFERNO_SCRIPT @@ -53,6 +55,13 @@ class TestNativeProfiling(TestBase): return self.run_cmd(['app_profiler.py', '--system_wide', '-r', '--duration 1']) + def test_device_not_connected(self): + args = [sys.executable, TestHelper.script_path('app_profiler.py'), '-cmd', 'ls'] + proc = subprocess.run( + args, env={'ANDROID_SERIAL': 'not_exist_device'}, + stderr=subprocess.PIPE, text=True) + self.assertIn('No Android device is connected via ADB.', proc.stderr) + class TestNativeLibDownloader(TestBase): def setUp(self): |