[Lldb-commits] [lldb] r231232 - Fix expectation for TestPlatformCommand.test_shell

Tamas Berghammer tberghammer at google.com
Wed Mar 4 03:18:35 PST 2015


Author: tberghammer
Date: Wed Mar  4 05:18:34 2015
New Revision: 231232

URL: http://llvm.org/viewvc/llvm-project?rev=231232&view=rev
Log:
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

Modified:
    lldb/trunk/source/API/SBPlatform.cpp
    lldb/trunk/test/functionalities/platform/TestPlatformCommand.py

Modified: lldb/trunk/source/API/SBPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBPlatform.cpp?rev=231232&r1=231231&r2=231232&view=diff
==============================================================================
--- lldb/trunk/source/API/SBPlatform.cpp (original)
+++ lldb/trunk/source/API/SBPlatform.cpp Wed Mar  4 05:18:34 2015
@@ -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

Modified: lldb/trunk/test/functionalities/platform/TestPlatformCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/platform/TestPlatformCommand.py?rev=231232&r1=231231&r2=231232&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/platform/TestPlatformCommand.py (original)
+++ lldb/trunk/test/functionalities/platform/TestPlatformCommand.py Wed Mar  4 05:18:34 2015
@@ -33,8 +33,11 @@ class PlatformCommandTestCase(TestBase):
 
     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"])
 





More information about the lldb-commits mailing list