Misc Android-related fixes.

- src/common/android/testing/mkdtemp.h:
  Fixes a compilation error when using the (recent) NDK r9b,
  see comments in the source file for details.

- android/test-driver, Makefile.am, Makefile.in:
  Autotools 1.12 changed the way tests are run during "make check"
  so add a new "custom test driver" to run tests on Android, and
  modify Makefile.am / Makefile.in accordingly. Otherwise,
  'make check' tried to run the tests on the host.

- android/test-shell.sh:
  Allow several tests to run in parallel on the device, by
  creating a custom test directory for each test process.
  This allows running "make check -j8" reliably.

- src/common/linux/file_id_unittest.cc:
  Disable the SelfStrip test on Android, since it assumes a 'strip'
  executable is available on the target system where the test runs.

BUG=NONE
R=mark@chromium.org, ted.mielczarek@gmail.com
TEST=android/run-checks.sh --ndk-dir=/path/to/android-ndk-r9b

Review URL: https://breakpad.appspot.com/904003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1259 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
digit@chromium.org 2013-12-13 16:49:11 +00:00
parent 4bcf51dc79
commit ba1f54c093
6 changed files with 163 additions and 13 deletions

View file

@ -27,9 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Android doesn't provide mkdtemp(). Keep this implementation in an
// C++ anonymous namespace to avoid conflicts on Chromium (which
// already provides an extern "C" mkdtemp function).
// mkdtemp() wasn't declared in <stdlib.h> until NDK r9b due to a simple
// packaging bug (the function has always been implemented in all versions
// of the C library). This header is provided to build Breakpad with earlier
// NDK revisions (e.g. the one used by Chromium). It may be removed in the
// future once all major projects upgrade to use a more recent NDK.
//
// The reason this is inlined here is to avoid linking a new object file
// into each unit test program (i.e. keep build files simple).
@ -44,9 +46,14 @@
#include <string.h>
#include <sys/stat.h>
// Using a macro renaming trick here is necessary when building against
// NDK r9b. Otherwise the compiler will complain that calls to mkdtemp()
// are ambiguous.
#define mkdtemp breakpad_mkdtemp
namespace {
char* mkdtemp(char* path) {
char* breakpad_mkdtemp(char* path) {
if (path == NULL) {
errno = EINVAL;
return NULL;