Skip to content

Commit

Permalink
Fix expectation for TestPlatformCommand.test_shell
Browse files Browse the repository at this point in the history
* Create expectation based on target platform
* Add custom expectation for remote android target

Differential revision: http://reviews.llvm.org/D8031

llvm-svn: 231232
  • Loading branch information
Tamas Berghammer committed Mar 4, 2015
1 parent 43f2d97 commit ccd28a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lldb/source/API/SBPlatform.cpp
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lldb/test/functionalities/platform/TestPlatformCommand.py
Expand Up @@ -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"])

Expand Down

0 comments on commit ccd28a1

Please sign in to comment.