2023-07-06 16:20:46 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
|
|
|
|
#include "oi/type_graph/DrgnParser.h"
|
|
|
|
|
2023-07-26 15:31:53 +01:00
|
|
|
namespace oi::detail {
|
|
|
|
class SymbolService;
|
|
|
|
}
|
|
|
|
namespace oi::detail::type_graph {
|
2023-07-06 16:20:46 +01:00
|
|
|
class TypeGraph;
|
|
|
|
}
|
|
|
|
struct drgn_type;
|
|
|
|
|
2023-07-26 15:31:53 +01:00
|
|
|
using namespace oi::detail;
|
|
|
|
|
2023-07-06 16:20:46 +01:00
|
|
|
class DrgnParserTest : public ::testing::Test {
|
|
|
|
protected:
|
2023-11-02 13:18:32 +00:00
|
|
|
static void SetUpTestSuite();
|
|
|
|
static void TearDownTestSuite();
|
2023-07-06 16:20:46 +01:00
|
|
|
|
2023-08-16 19:15:09 +01:00
|
|
|
static type_graph::DrgnParser getDrgnParser(
|
|
|
|
type_graph::TypeGraph& typeGraph, type_graph::DrgnParserOptions options);
|
2023-07-06 16:20:46 +01:00
|
|
|
drgn_type* getDrgnRoot(std::string_view function);
|
|
|
|
|
2023-08-16 19:15:09 +01:00
|
|
|
virtual std::string run(std::string_view function,
|
|
|
|
type_graph::DrgnParserOptions options);
|
2023-07-06 16:20:46 +01:00
|
|
|
void test(std::string_view function,
|
|
|
|
std::string_view expected,
|
2023-09-19 17:42:26 +01:00
|
|
|
type_graph::DrgnParserOptions options);
|
|
|
|
void test(std::string_view function, std::string_view expected);
|
2023-11-02 15:54:56 +00:00
|
|
|
void testGlob(std::string_view function,
|
|
|
|
std::string_view expected,
|
|
|
|
type_graph::DrgnParserOptions options = {});
|
2023-07-06 16:20:46 +01:00
|
|
|
void testMultiCompiler(std::string_view function,
|
|
|
|
std::string_view expectedClang,
|
|
|
|
std::string_view expectedGcc,
|
2023-08-16 19:15:09 +01:00
|
|
|
type_graph::DrgnParserOptions options = {});
|
2023-11-02 15:54:56 +00:00
|
|
|
void testMultiCompilerGlob(std::string_view function,
|
|
|
|
std::string_view expectedClang,
|
|
|
|
std::string_view expectedGcc,
|
|
|
|
type_graph::DrgnParserOptions options = {});
|
2023-07-06 16:20:46 +01:00
|
|
|
|
|
|
|
static SymbolService* symbols_;
|
|
|
|
};
|