Lines Matching +full:build +full:- +full:and +full:- +full:run +full:- +full:tests
4 # Redistribution and use in source and binary forms, with or without
9 # notice, this list of conditions and the following disclaimer.
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 set -o posix
42 . $PROGDIR/common-functions.sh
45 VALID_ABIS="armeabi armeabi-v7a x86 mips"
60 # The following extracts the value if the option is like --name=<value>.
61 optarg=$(expr -- $opt : '^--[^=]*=\(.*\)$')
63 --abi=*) ABI=$optarg;;
64 --adb=*) ADB=$optarg;;
65 --all-tests) ALL_TESTS=true;;
66 --enable-m32) ENABLE_M32=true;;
67 --help|-h|-?) HELP=TRUE;;
68 --help-all) HELP_ALL=true;;
69 --jobs=*) NUM_JOBS=$optarg;;
70 --ndk-dir=*) NDK_DIR=$optarg;;
71 --tmp-dir=*) TMPDIR=$optarg;;
72 --no-cleanup) NO_CLEANUP=true;;
73 --no-device) NO_DEVICE=true;;
74 --quiet) decrease_verbosity;;
75 --verbose) increase_verbosity;;
76 -*) panic "Invalid option '$opt', see --help for details.";;
77 *) panic "This script doesn't take any parameters. See --help for details."
82 if [ "$HELP" -o "$HELP_ALL" ]; then
87 be properly built for Android, and that the client library and host tools
94 - Rebuild the host version of Google Breakpad in a temporary
95 directory (with the Auto-tools based build system).
97 - Rebuild the Android client library with the Google Breakpad build
100 installation directory, or use the --ndk-dir=<path> option.
102 - Rebuild the Android client library and a test crashing program with the
103 Android NDK build system (ndk-build).
105 - Require an Android device connected to your machine, and the 'adb'
108 - Install and run a test crashing program.
109 - Extract the corresponding minidump from the device.
110 - Dump the symbols from the test program on the host with 'dump_syms'
111 - Generate a stack trace with 'minidump_stackwalk'
112 - Check the stack trace content for valid source file locations.
114 You can however skip this requirement and only test the builds by using
115 the --no-device flag.
119 files, use the --no-cleanup option.
121 Finally, use --verbose to increase the verbosity level, this will help
122 you see which exact commands are being issues and their result. Use the
123 flag twice for even more output. Use --quiet to decrease verbosity
124 instead and run the script silently.
127 its primary CPU ABI, and build the test program for it. You can however
128 use the --abi=<name> option to override this (this can be useful to check
129 the secondary ABI, e.g. using --abi=armeabi to check that such a program
130 works correctly on an ARMv7-A device).
133 not run) with the default '$DEFAULT_ABI' ABI. Again, you can use
134 --abi=<name> to override this. Valid ABI names are:
138 The script will only run the client library unit test on the device
139 by default. You can use --all-tests to also build and run the unit
140 tests for the Breakpad tools and processor, but be warned that this
141 adds several minutes of testing time. --all-tests will also run the
142 host unit tests suite.
150 --help|-h|-? Display this message.
151 --help-all Display extended help.
152 --enable-m32 Build 32-bit version of host tools.
153 --abi=<name> Specify target CPU ABI [auto-detected].
154 --jobs=<count> Run <count> build tasks in parallel [$NUM_JOBS].
155 --ndk-dir=<path> Specify NDK installation directory.
156 --tmp-dir=<path> Specify temporary directory (will be wiped-out).
157 --adb=<path> Specify adb program path.
158 --no-cleanup Don't remove temporary directory after completion.
159 --no-device Do not try to detect devices, nor run crash test.
160 --all-tests Run all unit tests (i.e. tools and processor ones too).
161 --verbose Increase verbosity.
162 --quiet Decrease verbosity."
170 if [ -z "$NDK_DIR" ]; then
171 if [ -z "$ANDROID_NDK_ROOT" ]; then
173 --ndk-dir=<path>."
181 NDK_BUILD="$NDK_DIR/ndk-build"
182 if [ ! -f "$NDK_BUILD" ]; then
183 panic "Your NDK directory is not valid (missing ndk-build): $NDK_DIR"
186 # Ensure the temporary directory is deleted on exit, except if the --no-cleanup
191 if [ -z "$NO_CLEANUP" ]; then
193 rm -rf "$TMPDIR"
203 # If --tmp-dir=<path> is not used, create a temporary directory.
204 # Otherwise, start by cleaning up the user-provided path.
205 if [ -z "$TMPDIR" ]; then
206 TMPDIR=$(mktemp -d /tmp/$PROGNAME.XXXXXXXX)
210 if [ ! -d "$TMPDIR" ]; then
211 mkdir -p "$TMPDIR"
215 rm -rf "$TMPDIR"/*
220 if [ -z "$NO_DEVICE" ]; then
223 echo "Use --no-device to build the code without running any tests."
228 BUILD_LOG="$TMPDIR/build.log"
229 RUN_LOG="$TMPDIR/run.log"
234 TMPHOST="$TMPDIR/host-local"
238 # Build host version of the tools
242 CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-m32"
245 run mkdir "$TMPDIR/build-host" &&
246 run cd "$TMPDIR/build-host" &&
247 run2 "$PROGDIR/../configure" --prefix="$TMPHOST" $CONFIGURE_FLAGS &&
248 run2 make -j$NUM_JOBS install
250 fail_panic "Can't build host binaries!"
253 dump "Running host unit tests."
255 run cd "$TMPDIR/build-host" &&
256 run2 make -j$NUM_JOBS check
258 fail_panic "Host unit tests failed!!"
263 # Generate a stand-alone NDK toolchain
265 # Extract CPU ABI and architecture from device, if any.
269 if [ -z "$DEVICE_ABI" ]; then
279 # If --abi=<name> is used, check that the device supports it.
280 if [ "$ABI" -a "$DEVICE_ABI" != "$ABI" -a "$DEVICE_ABI2" != "$ABI" ]; then
281 dump "ERROR: Device ABI(s) do not match --abi command-line value ($ABI)!"
282 panic "Please use --no-device to skip device tests."
285 if [ -z "$ABI" ]; then
289 dump "Using CPU ABI: $ABI (command-line)"
292 if [ -z "$ABI" ]; then
297 dump "Using CPU ABI: $ABI (command-line)"
310 if [ -z "$VALID" ]; then
323 GNU_CONFIG=arm-linux-androideabi
326 GNU_CONFIG=i686-linux-android
329 GNU_CONFIG=mipsel-linux-android
332 GNU_CONFIG="$ARCH-linux-android"
337 NDK_STANDALONE="$TMPDIR/ndk-$ARCH-toolchain"
339 mkdir -p "$NDK_STANDALONE"
340 # NOTE: The --platform=android-9 is required to provide <regex.h> for GTest.
341 run "$NDK_DIR/build/tools/make-standalone-toolchain.sh" \
342 --arch="$ARCH" \
343 --platform=android-9 \
344 --install-dir="$NDK_STANDALONE"
347 # Rebuild the client library, processor and tools with the auto-tools based
348 # build system. Even though it's not going to be used, this checks that this
351 TMPTARGET="$TMPDIR/target-local"
354 run mkdir "$TMPTARGET" &&
355 run mkdir "$TMPDIR"/build-target &&
356 run cd "$TMPDIR"/build-target &&
357 run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
358 --host="$GNU_CONFIG" &&
359 run2 make -j$NUM_JOBS install
363 # Build and/or run unit test suite.
364 # If --no-device is used, only rebuild it, otherwise, run in on the
377 run cd "$TMPDIR"/build-target &&
378 # Reconfigure to only run the client unit test suite.
380 dump "$ACTION Android client library unit tests."
381 run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
382 --host="$GNU_CONFIG" \
383 --disable-tools \
384 --disable-processor &&
385 run make -j$NUM_JOBS check $TESTS_ENVIRONMENT || exit $?
388 dump "$ACTION Tools and processor unit tests."
389 # Reconfigure to run the processor and tools tests.
391 run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
392 --host="$GNU_CONFIG" &&
393 run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
395 dump "Tools and processor unit tests failed as expected. \
396 Use --verbose for results."
405 run cp -r "$TESTAPP_DIR" "$PROJECT_DIR" &&
406 run rm -rf "$PROJECT_DIR/obj" &&
407 run rm -rf "$PROJECT_DIR/libs"
410 # Build the test program with ndk-build.
411 dump "Building test program with ndk-build"
413 NDK_BUILD_FLAGS="-j$NUM_JOBS"
417 run "$NDK_DIR/ndk-build" -C "$PROJECT_DIR" $NDK_BUILD_FLAGS APP_ABI=$ABI
418 fail_panic "Can't build test program!"
420 # Unless --no-device was used, stop right here if ADB isn't in the path,
423 dump "Done. Please connect a device to run all tests!"
430 if [ ! -f "$TESTAPP_FILE" ]; then
434 # Run the program there
446 echo -n "Crash log: "
453 if [ -z "$MINIDUMP_NAME" ]; then
471 if [ -z "$VERSION" ]; then
473 head -n5 $TESTAPP.sym
477 run mkdir -p "$TMPDIR/symbols/$TESTAPP/$VERSION"
478 run mv $TESTAPP.sym "$TMPDIR/symbols/$TESTAPP/$VERSION/"
481 # Don't use 'run' to be able to send stdout and stderr to two different files.
517 # First, extract all the lines with test_google_breakpad! in them, and
525 if [ -z "$LOCATIONS" ]; then