From ccd28a147bad554204d9140584c73629b2b31361 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Wed, 4 Mar 2015 11:18:34 +0000 Subject: [PATCH] Fix expectation for TestPlatformCommand.test_shell * Create expectation based on target platform * Add custom expectation for remote android target Differential revision: http://reviews.llvm.org/D8031 llvm-svn: 231232 --- lldb/source/API/SBPlatform.cpp | 2 +- lldb/test/functionalities/platform/TestPlatformCommand.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp index b23891d39c211..a52287020d121 100644 --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -378,7 +378,7 @@ SBPlatform::GetTriple() PlatformSP platform_sp(GetSP()); if (platform_sp) { - ArchSpec arch(platform_sp->GetRemoteSystemArchitecture()); + ArchSpec arch(platform_sp->GetSystemArchitecture()); if (arch.IsValid()) { // Const-ify the string so we don't need to worry about the lifetime of the string diff --git a/lldb/test/functionalities/platform/TestPlatformCommand.py b/lldb/test/functionalities/platform/TestPlatformCommand.py index 25406429ef978..5bf812602672c 100644 --- a/lldb/test/functionalities/platform/TestPlatformCommand.py +++ b/lldb/test/functionalities/platform/TestPlatformCommand.py @@ -33,8 +33,11 @@ def test_status(self): def test_shell(self): """ Test that the platform shell command can invoke ls. """ - if sys.platform.startswith("win32"): + triple = self.dbg.GetSelectedPlatform().GetTriple() + if re.match(".*-.*-windows", triple): self.expect("platform shell dir c:\\", substrs = ["Windows", "Program Files"]) + elif re.match(".*-.*-.*-android", triple): + self.expect("platform shell ls /", substrs = ["cache", "dev", "system"]) else: self.expect("platform shell ls /", substrs = ["dev", "tmp", "usr"])