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_client_linux_linux_client_unittest_shlib_SOURCES += \
src/common/android/breakpad_getcontext_unittest.cc src/common/android/breakpad_getcontext_unittest.cc
src_client_linux_linux_client_unittest_shlib_LDFLAGS += \ src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
-llog -llog -lm
endif endif
src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \ 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_SOURCES =
src_client_linux_linux_client_unittest_LDFLAGS = \ src_client_linux_linux_client_unittest_LDFLAGS = \
-Wl,-rpath,'$$ORIGIN' -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_LDADD = \
src/client/linux/linux_client_unittest_shlib 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@am__append_17 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog @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 = noinst_PROGRAMS =
subdir = . subdir = .
DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \ DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
@ -1582,8 +1585,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES = @LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES =
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \ @LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \
@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' @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_LDADD = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib

View file

@ -369,28 +369,33 @@ else
ACTION="Running" ACTION="Running"
TESTS_ENVIRONMENT= TESTS_ENVIRONMENT=
fi 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" PATH="$NDK_STANDALONE/bin:$PATH"
run cd "$TMPDIR"/build-target && run cd "$TMPDIR"/build-target &&
if [ -z "$ALL_TESTS" ]; then # Reconfigure to only run the client unit test suite.
# Reconfigure to avoid building the unit tests for the tools # This one should _never_ fail.
# and processor, unless --all-tests is used. dump "$ACTION Android client library unit tests."
run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \ run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
--host="$GNU_CONFIG" \ --host="$GNU_CONFIG" \
--disable-tools \ --disable-tools \
--disable-processor --disable-processor &&
fi && 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" &&
run make -j$NUM_JOBS check $TESTS_ENVIRONMENT 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 fail_panic "Client library unit test suite failed!"
dump " Unit tests failed as expected. Use --verbose to see results."
fi
# Copy sources to temporary directory # Copy sources to temporary directory
PROJECT_DIR=$TMPDIR/project PROJECT_DIR=$TMPDIR/project

View file

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