Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 086e33f4 authored by Colin Cross's avatar Colin Cross
Browse files

Hide most symbols in libmemunreachable

In preparation for making libmemunreachble vendor_available, hide
everything but the public ABI using a version script.  The unit
tests now have to compile statically against libmemunreachable,
so split out the tests that run against the public API into a
separate test.

Bug: 132302484
Test: atest memunreachable_test memunreachable_unit_test
Change-Id: Ie9dec073fdeee342776566abedd50f7498476eca
parent 025ed8aa
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -27,6 +27,13 @@
    {
      "name": "memunreachable_test"
    },
    {
      "name": "memunreachable_unit_test"
    },
    {
      "name": "memunreachable_unit_test",
      "host": true
    },
    {
      "name": "memunreachable_binder_test"
    },
+15 −1
Original line number Diff line number Diff line
@@ -48,11 +48,24 @@ cc_library {
    },
    export_include_dirs: ["include"],
    local_include_dirs: ["include"],
    version_script: "libmemunreachable.map",
}

// Integration test that runs against the public API of libmemunreachable
cc_test {
    name: "memunreachable_test",
    defaults: ["libmemunreachable_defaults"],
    srcs: [
        "tests/MemUnreachable_test.cpp",
    ],
    shared_libs: ["libmemunreachable"],

    test_suites: ["device-tests"],
}

cc_test {
    name: "memunreachable_unit_test",
    defaults: ["libmemunreachable_defaults"],
    host_supported: true,
    srcs: [
        "tests/Allocator_test.cpp",
@@ -67,8 +80,9 @@ cc_test {
                "tests/MemUnreachable_test.cpp",
                "tests/ThreadCapture_test.cpp",
            ],
            shared_libs: [
            static_libs: [
                "libmemunreachable",
                "libc_malloc_debug_backtrace",
            ],
        },
        host: {
+13 −0
Original line number Diff line number Diff line
LIBMEMUNREACHABLE {
  global:
    LogUnreachableMemory;
    NoLeaks;
    extern "C++" {
      android::GetUnreachableMemory*;
      android::GetUnreachableMemoryString*;
      android::Leak::*;
      android::UnreachableMemoryInfo::*;
    };
  local:
    *;
};