[Lldb-commits] [PATCH] D64118: [lldb_test_suite] Fix lldb test suite targeting remote Android
Wanyi Ye via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 2 20:10:05 PDT 2019
kusmour created this revision.
kusmour added a reviewer: xiaobai.
Herald added subscribers: lldb-commits, srhines.
Herald added a project: LLDB.
Fixed `Android.rules` for running test suite on remote android
- the build configuration is not compatible with ndk structure, change it to link to static libc++
- generally clang should be able to use libc++ and will link against the right library, but some libc++ installations require the user manually link libc++abi.
- add flag `-lc++abi` to fix the test binary build failure
Added `skipIfTargetAndroid` for better test support
- the `skipIfPlatform` method will ask `lldbplatformutil.getPlatform()` for platform info which is actually the os type, and *Android* is not os type but environment
- create this function to handle the android target condition
Repository:
rLLDB LLDB
https://reviews.llvm.org/D64118
Files:
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
lldb/packages/Python/lldbsuite/test/decorators.py
lldb/packages/Python/lldbsuite/test/make/Android.rules
Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===================================================================
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -90,5 +90,6 @@
ARCH_LDFLAGS += \
-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
- $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
+ $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
+ -lc++abi
endif
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -606,6 +606,10 @@
"""Decorate the item to skip tests that should be skipped on any non Darwin platform."""
return skipUnlessPlatform(lldbplatformutil.getDarwinOSTriples())(func)
+def skipUnlessTargetAndroid(func):
+ return unittest2.skipUnless(lldbplatformutil.target_is_android(),
+ "requires target to be Android")(func)
+
def skipIfHostIncompatibleWithRemote(func):
"""Decorate the item to skip tests if binaries built on this host are incompatible."""
Index: lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -16,7 +16,7 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessPlatform(['android'])
+ @skipUnlessTargetAndroid
def test_cache_line_size(self):
self.build(dictionary=self.getBuildFlags())
exe = self.getBuildArtifact("a.out")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64118.207701.patch
Type: text/x-patch
Size: 1862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190703/cbb59428/attachment.bin>
More information about the lldb-commits
mailing list