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

Commit 5e9d98a7 authored by Myles Watson's avatar Myles Watson
Browse files

Remove LogCapture from testing

LogCapture is deprecated in favor of GTEST.

Bug: 330395361
Test: mma -j32
Flag: EXEMPT, test infrastructure change
Change-Id: I46e1c88c298a6c789ad54675933c9553f86c1a94
parent 4c9f5d8f
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -146,18 +146,6 @@ cc_test {
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/include",
    ],
    target: {
        host: {
            srcs: [
                ":BluetoothHostTestingLogCapture",
            ],
        },
        android: {
            srcs: [
                ":BluetoothAndroidTestingLogCapture",
            ],
        },
    },
    sanitize: {
        cfi: true,
        scs: true,
+0 −4
Original line number Diff line number Diff line
@@ -387,15 +387,11 @@ cc_test {
        host: {
            srcs: [
                ":BluetoothHalTestSources_hci_host",
                ":BluetoothHostTestingLogCapture",
                ":BluetoothHostTestingLogCaptureTest",
                ":BluetoothOsTestSources_host",
            ],
        },
        android: {
            srcs: [
                ":BluetoothAndroidTestingLogCapture",
                ":BluetoothAndroidTestingLogCaptureTest",
                ":BluetoothHalTestSources_hci_android_hidl",
                ":BluetoothOsTestSources_android",
            ],
+0 −36
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

filegroup {
    name: "BluetoothAndroidTestingLogCapture",
    srcs: [
        "android/log_capture.cc",
    ],
}

filegroup {
    name: "BluetoothAndroidTestingLogCaptureTest",
    srcs: [
        "android/log_capture_test.cc",
    ],
}

filegroup {
    name: "BluetoothHostTestingLogCapture",
    srcs: [
        "host/log_capture.cc",
    ],
}

filegroup {
    name: "BluetoothHostTestingLogCaptureTest",
    srcs: [
        "host/log_capture_test.cc",
    ],
}
+0 −80
Original line number Diff line number Diff line
/*
 * Copyright 2022 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 "common/testing/log_capture.h"

#include <bluetooth/log.h>
#include <fcntl.h>
#include <sys/stat.h>

#include <cstddef>
#include <string>

#include "os/log.h"

namespace bluetooth {
namespace testing {

LogCapture::LogCapture() {
  log::info(
      "Log capture disabled for android build dup_fd:{} fd:{} original_stderr_fd:{}",
      dup_fd_,
      fd_,
      original_stderr_fd_);
}

LogCapture::~LogCapture() {}

LogCapture* LogCapture::Rewind() {
  return this;
}

bool LogCapture::Find(const std::string& /* to_find */) {
  // For |atest| assume all log captures succeed
  return true;
}

void LogCapture::Flush() {}

void LogCapture::Sync() {}

void LogCapture::Reset() {}

std::string LogCapture::Read() {
  return std::string();
}

size_t LogCapture::Size() const {
  size_t size{0UL};
  return size;
}

void LogCapture::WaitUntilLogContains(const std::string& /* text */) {}

std::pair<int, int> LogCapture::create_backing_store() const {
  int dup_fd = -1;
  int fd = -1;
  return std::make_pair(dup_fd, fd);
}

bool LogCapture::set_non_blocking(int /* fd */) const {
  return true;
}

void LogCapture::clean_up() {}

}  // namespace testing
}  // namespace bluetooth
+0 −41
Original line number Diff line number Diff line
/*
 * Copyright 2022 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 "../log_capture.h"

#include <gtest/gtest.h>

#include <cstring>
#include <memory>
#include <string>

#include "common/init_flags.h"
#include "os/log.h"

namespace bluetooth {
namespace testing {

class LogCaptureTest : public ::testing::Test {
 protected:
  void SetUp() override {}

  void TearDown() override {}
};

TEST_F(LogCaptureTest, not_working_over_atest) {}

}  // namespace testing
}  // namespace bluetooth
Loading