tberghammer accepted this revision.
tberghammer added a comment.

Looks reasonable and I agree with Pavel in the idea of moving the android 
related utility functions into their own file for better separation


================
Comment at: packages/Python/lldbsuite/test/lldbplatformutil.py:73-81
@@ +72,11 @@
+
+def match_android_device(device_arch, valid_archs=None, valid_api_levels=None):
+    if not _target_is_android():
+        return AndroidMatchResult.InvalidTarget
+    if valid_archs is not None and device_arch not in valid_archs:
+        return AndroidMatchResult.InvalidArch
+    if valid_api_levels is not None and android_device_api() not in 
valid_api_levels:
+        return AndroidMatchResult.InvalidApiLevel
+
+    return AndroidMatchResult.Matched
+
----------------
Can we just return True/False? I don't see any usecase where we are caring 
about the reason why the device isn't matched.

================
Comment at: packages/Python/lldbsuite/test/lldbtest.py:683-685
@@ -741,2 +682,5 @@
     """
-    return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
+    def skip_for_android(self):
+        result = lldbplatformutil.match_android_device(self.getArchitecture(), 
archs, api_levels)
+        return "skipping for android" if result == 
lldbplatformutil.AndroidMatchResult.Matched else None
+    return expectedFailure(skip_for_android, bugnumber)
----------------
Can we move this function to a higher scope so we don't have to duplicate it in 
every android specific decorator?


http://reviews.llvm.org/D16830



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to