OmniSciDB  04ee39c94c
anonymous_namespace{UdfTest.cpp}::SQLTestEnv Class Reference
+ Inheritance diagram for anonymous_namespace{UdfTest.cpp}::SQLTestEnv:
+ Collaboration diagram for anonymous_namespace{UdfTest.cpp}::SQLTestEnv:

Public Member Functions

void SetUp () override
 
void TearDown () override
 

Detailed Description

Definition at line 105 of file UdfTest.cpp.

Member Function Documentation

◆ SetUp()

void anonymous_namespace{UdfTest.cpp}::SQLTestEnv::SetUp ( )
inlineoverride

Definition at line 107 of file UdfTest.cpp.

References BASE_PATH, UdfCompiler::compileUdf(), QueryRunner::QueryRunner::get(), anonymous_namespace{UdfTest.cpp}::get_udf_filename(), QueryRunner::QueryRunner::getCalcite(), and QueryRunner::QueryRunner::init().

107  {
108  boost::filesystem::path udf_file((get_udf_filename()));
109  if (!boost::filesystem::exists(udf_file)) {
110  throw std::runtime_error("udf file: " + udf_file.string() + " does not exist");
111  }
112 
113  UdfCompiler compiler(udf_file.string());
114  auto compile_result = compiler.compileUdf();
115  EXPECT_EQ(compile_result, 0);
116 
117  QR::init(BASE_PATH, compiler.getAstFileName());
118 
120  }
std::shared_ptr< Calcite > getCalcite() const
static QueryRunner * init(const char *db_path, const std::string &udf_filename="", const size_t max_gpu_mem=0, const int reserved_gpu_mem=256<< 20)
Definition: QueryRunner.h:70
std::shared_ptr< Calcite > g_calcite
Definition: UdfTest.cpp:54
static QueryRunner * get()
Definition: QueryRunner.h:115
int compileUdf()
#define BASE_PATH
Definition: UdfTest.cpp:37
+ Here is the call graph for this function:

◆ TearDown()

void anonymous_namespace{UdfTest.cpp}::SQLTestEnv::TearDown ( )
inlineoverride

Definition at line 122 of file UdfTest.cpp.

References anonymous_namespace{UdfTest.cpp}::get_udf_ast_filename(), anonymous_namespace{UdfTest.cpp}::get_udf_cpu_ir_filename(), anonymous_namespace{UdfTest.cpp}::get_udf_gpu_ir_filename(), and QueryRunner::QueryRunner::reset().

122  {
123  boost::filesystem::path cpu_ir_file(get_udf_cpu_ir_filename());
124  if (boost::filesystem::exists(cpu_ir_file)) {
125  boost::filesystem::remove(cpu_ir_file);
126  }
127 
128  boost::filesystem::path gpu_ir_file(get_udf_gpu_ir_filename());
129  if (boost::filesystem::exists(gpu_ir_file)) {
130  boost::filesystem::remove(gpu_ir_file);
131  }
132 
133  boost::filesystem::path udf_ast_file(get_udf_ast_filename());
134  if (boost::filesystem::exists(udf_ast_file)) {
135  boost::filesystem::remove(udf_ast_file);
136  }
137 
138  QR::reset();
139  }
std::string get_udf_cpu_ir_filename()
Definition: UdfTest.cpp:81
std::string get_udf_gpu_ir_filename()
Definition: UdfTest.cpp:85
std::string get_udf_ast_filename()
Definition: UdfTest.cpp:89
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: