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

Commit 3ec2f3ee authored by Christopher Ferris's avatar Christopher Ferris Committed by android-build-merger
Browse files

Merge "Move to isolated testing."

am: 604ccb14

Change-Id: I1003c6b6be21e1ef20ecd89842bd5189aab26403
parents 1c4f14f4 604ccb14
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ cc_test_library {
cc_test {
    name: "libunwindstack_test",
    defaults: ["libunwindstack_flags"],
    isolated: true,

    srcs: [
        "tests/ArmExidxDecodeTest.cpp",
@@ -180,6 +181,7 @@ cc_test {
        "tests/ElfInterfaceTest.cpp",
        "tests/ElfTest.cpp",
        "tests/ElfTestUtils.cpp",
        "tests/IsolatedSettings.cpp",
        "tests/JitDebugTest.cpp",
        "tests/LocalUnwinderTest.cpp",
        "tests/LogFake.cpp",
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <stdint.h>
#include <stdio.h>

extern "C" bool GetInitialArgs(const char*** args, size_t* num_args) {
  static const char* initial_args[2] = {"--slow_threshold_ms=90000",
                                        "--deadline_threshold_ms=120000"};
  *args = initial_args;
  *num_args = 2;
  return true;
}
+5 −11
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ class MapInfoCreateMemoryTest : public ::testing::Test {
    ASSERT_TRUE(android::base::WriteFully(fd, buffer.data(), buffer.size()));
  }

  static void SetUpTestSuite() {
  void SetUp() override {
    std::vector<uint8_t> buffer(12288, 0);
    memcpy(buffer.data(), ELFMAG, SELFMAG);
    buffer[EI_CLASS] = ELFCLASS32;
@@ -72,9 +72,7 @@ class MapInfoCreateMemoryTest : public ::testing::Test {

    InitElf<Elf32_Ehdr, Elf32_Shdr>(elf32_at_map_.fd, 0x1000, 0x2000, ELFCLASS32);
    InitElf<Elf64_Ehdr, Elf64_Shdr>(elf64_at_map_.fd, 0x2000, 0x3000, ELFCLASS64);
  }

  void SetUp() override {
    memory_ = new MemoryFake;
    process_memory_.reset(memory_);
  }
@@ -82,17 +80,13 @@ class MapInfoCreateMemoryTest : public ::testing::Test {
  MemoryFake* memory_;
  std::shared_ptr<Memory> process_memory_;

  static TemporaryFile elf_;
  TemporaryFile elf_;

  static TemporaryFile elf_at_1000_;
  TemporaryFile elf_at_1000_;

  static TemporaryFile elf32_at_map_;
  static TemporaryFile elf64_at_map_;
  TemporaryFile elf32_at_map_;
  TemporaryFile elf64_at_map_;
};
TemporaryFile MapInfoCreateMemoryTest::elf_;
TemporaryFile MapInfoCreateMemoryTest::elf_at_1000_;
TemporaryFile MapInfoCreateMemoryTest::elf32_at_map_;
TemporaryFile MapInfoCreateMemoryTest::elf64_at_map_;

TEST_F(MapInfoCreateMemoryTest, end_le_start) {
  MapInfo info(nullptr, 0x100, 0x100, 0, 0, elf_.path);