New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 804821 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

crazy_linker: Enable unit and integration tests when building with Chrome

Project Member Reported by digit@chromium.org, Jan 23 2018

Issue description

//third_party/android_crazy_linker was originally from the Android NDK but has been heavily modified and is now mainly developed and maintained for Chromium.

The original sources have several unit and integration tests that are never built or run when building Chromium. This should be fixed to ensure any change we perform there can be caught as soon as possible during development.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a9b6bd41164e5954d0d314c08f1a7472d123613a

commit a9b6bd41164e5954d0d314c08f1a7472d123613a
Author: David 'Digit' Turner <digit@google.com>
Date: Wed Jan 24 08:20:28 2018

Add android_crazy_linker_unittests target.

This patch adds a new GN target that generates an executable
to run the crazy linker's unit tests. These depended on a very
small testing framework (minitest) inspired by GoogleTest,
but which doesn't depend on any C++ standard library.

Minitest was necessary when the crazy linker was part of the
NDK, but when building these unit tests for Chromium, we
can link everything to GoogleTest and a standard C++ library
to run them, so remove it.

For now, the test must be built and run manually with:

  gn $OUTPUT_DIR android_crazy_linker_unittests
  $OUTPUT_DIR/bin/run_android_crazy_linker_unittests

NOTE: The differences between minitest and GoogleTest were
      pretty minor, i.e.:

       - minitest uses a TEST_TEXT macro to be able to
         print assertion failure messages, while GoogleTest
         just uses the << operator after each macro.

       - CHECK_GT and CHECK_LT have different operand order.

NOTE2: There are other integration tests under src/tests/
       that provide a mix of libraries and executables to
       check that crazy linker features work properly.

       These will be ported later to the Chromium
       infrastructure.

BUG=804821
R=pasko@chromium.org,agrieve@chromium.org,rmcilroy@chromium.org

Change-Id: Ic7c314e35b35e2fb8b939d0a88b314f106433be7
Reviewed-on: https://chromium-review.googlesource.com/881016
Commit-Queue: David Turner <digit@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531479}
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/BUILD.gn
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/README.chromium
[delete] https://crrev.com/391d909bf8ff508c895164adae6aa5ab7cf4c454/third_party/android_crazy_linker/src/minitest
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_ashmem_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_error_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_globals_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_line_reader_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_proc_maps_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_search_path_list_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_system.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_system_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_thread_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_util_unittest.cpp
[modify] https://crrev.com/a9b6bd41164e5954d0d314c08f1a7472d123613a/third_party/android_crazy_linker/src/src/crazy_linker_wrappers.cpp

Comment 2 by digit@chromium.org, Jan 25 2018

For the record, another CL added integration tests:
https://chromium-review.googlesource.com/c/chromium/src/+/883202

Unfortunately, I put an incorrect BUG number in the commit message, hence why there is no bugdroid@ update for its submission.

Next step will be exploring options to add the unit-tests and integration tests to the CQ :)
Status: Verified (was: Started)
Setting this as verified. Since the CL #2 one can test the crazy linker with:

ninja -C out/Release android_crazy_linker_tests
out/Release/bin/run_android_crazy_linker_unittests
out/Release/bin/run_android_crazy_linker_tests

Just out of interest, are they running on the waterfall / CQ?
Status: Assigned (was: Verified)
aarh, no, I thought I had filed another bug for the waterfall issue, but I can't find it. So re-opening. Thanks!

Sign in to add a comment