
Adds a `check-offload-unit` target for running the liboffload unit test suite. This unit test binary runs the tests for every available device. This can optionally filtered to devices from a single platform, but the check target runs on everything. The target is not part of `check-offload` and does not get propagated to the top level build. I'm not sure if either of these things are desirable, but I'm happy to look into it if we want. Also remove the `offload/unittests/Plugins` test as it's dead code and doesn't build.
27 lines
830 B
C++
27 lines
830 B
C++
//===------- Offload API tests - gtest environment ------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#pragma once
|
|
|
|
#include "llvm/Support/MemoryBuffer.h"
|
|
#include <OffloadAPI.h>
|
|
#include <gtest/gtest.h>
|
|
|
|
namespace TestEnvironment {
|
|
|
|
struct Device {
|
|
ol_device_handle_t Handle;
|
|
std::string Name;
|
|
};
|
|
|
|
const std::vector<Device> &getDevices();
|
|
ol_device_handle_t getHostDevice();
|
|
bool loadDeviceBinary(const std::string &BinaryName, ol_device_handle_t Device,
|
|
std::unique_ptr<llvm::MemoryBuffer> &BinaryOut);
|
|
} // namespace TestEnvironment
|