Fix the Android unit tests.

- One of the unit test binaries refused to link due to
  missing linker flags.

- The WriteDSODebug() function now works on Android, so
  do not special-case it anymore.

- Ensure android/run-checks.sh will complain properly if
  the client unit test suite fails on Android. It used to
  consider that such failures were acceptable. Note that
  it still considers failures when running the tools and
  processor test suite on the device normal (fixing this
  is a lot harder, and these parts of Breakpad typically
  never run on a device, but on the host).
Review URL: https://breakpad.appspot.com/482002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1066 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
digit@chromium.org 2012-10-09 17:15:06 +00:00
parent 1500c41966
commit b52be69e59
4 changed files with 31 additions and 24 deletions

View file

@ -388,7 +388,7 @@ if ANDROID_HOST
src_client_linux_linux_client_unittest_shlib_SOURCES += \
src/common/android/breakpad_getcontext_unittest.cc
src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
-llog
-llog -lm
endif
src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
@ -399,6 +399,10 @@ src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
src_client_linux_linux_client_unittest_SOURCES =
src_client_linux_linux_client_unittest_LDFLAGS = \
-Wl,-rpath,'$$ORIGIN'
if ANDROID_HOST
src_client_linux_linux_client_unittest_LDFLAGS += \
-llog
endif
src_client_linux_linux_client_unittest_LDADD = \
src/client/linux/linux_client_unittest_shlib

View file

@ -167,6 +167,9 @@ check_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_17 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_18 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog
noinst_PROGRAMS =
subdir = .
DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
@ -1581,9 +1584,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@LINUX_HOST_TRUE@ src/libbreakpad.a
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES =
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \
@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN'
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \
@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' $(am__append_18)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDADD = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib

View file

@ -369,28 +369,33 @@ else
ACTION="Running"
TESTS_ENVIRONMENT=
fi
if [ "$ALL_TESTS" ]; then
dump "$ACTION full Android unit tests."
else
dump "$ACTION Android client library unit tests."
fi
(
PATH="$NDK_STANDALONE/bin:$PATH"
run cd "$TMPDIR"/build-target &&
if [ -z "$ALL_TESTS" ]; then
# Reconfigure to avoid building the unit tests for the tools
# and processor, unless --all-tests is used.
# Reconfigure to only run the client unit test suite.
# This one should _never_ fail.
dump "$ACTION Android client library unit tests."
run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
--host="$GNU_CONFIG" \
--disable-tools \
--disable-processor &&
run make -j$NUM_JOBS check $TESTS_ENVIRONMENT || exit $?
if [ "$ALL_TESTS" ]; then
dump "$ACTION Tools and processor unit tests."
# Reconfigure to run the processor and tools tests.
# Most of these fail for now, so do not worry about it.
run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
--host="$GNU_CONFIG" \
--disable-tools \
--disable-processor
fi &&
run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
--host="$GNU_CONFIG" &&
run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
if [ $? != 0 ]; then
dump "Tools and processor unit tests failed as expected. \
Use --verbose for results."
fi
fi
)
if [ -z "$NO_DEVICE" ] && verbosity_is_lower_than 2; then
dump " Unit tests failed as expected. Use --verbose to see results."
fi
fail_panic "Client library unit test suite failed!"
# Copy sources to temporary directory
PROJECT_DIR=$TMPDIR/project

View file

@ -983,9 +983,6 @@ class MinidumpWriter {
}
bool WriteDSODebugStream(MDRawDirectory* dirent) {
#if defined(__ANDROID__)
return false;
#else
ElfW(Phdr)* phdr = reinterpret_cast<ElfW(Phdr) *>(dumper_->auxv()[AT_PHDR]);
char* base;
int phnum = dumper_->auxv()[AT_PHNUM];
@ -1106,7 +1103,6 @@ class MinidumpWriter {
delete[] dso_debug_data;
return true;
#endif
}
private: