HAL
hgl_parser.cpp
Go to the documentation of this file.
2 
3 #include "gate_library_test_utils.h"
4 #include "netlist_test_utils.h"
5 
6 namespace hal
7 {
8  class HGLParserTest : public ::testing::Test
9  {
10  protected:
11  virtual void SetUp()
12  {
13  test_utils::init_log_channels();
14  }
15 
16  virtual void TearDown()
17  {
18  }
19  };
20 
26  TEST_F(HGLParserTest, check_library)
27  {
28  TEST_START
29  {
30  std::string path_lib = utils::get_base_directory().string() + "/bin/hal_plugins/test-files/test.hgl";
31 
33  auto gl_res = parser.parse(path_lib);
34  ASSERT_TRUE(gl_res.is_ok());
35  std::unique_ptr<GateLibrary> gl_parsed = gl_res.get();
36  const GateLibrary* gl_original = test_utils::get_gate_library();
37  ASSERT_NE(gl_parsed.get(), nullptr);
38  ASSERT_NE(gl_original, nullptr);
39 
40  EXPECT_TRUE(test_utils::gate_libraries_are_equal(gl_parsed.get(), gl_original));
41  }
42  TEST_END
43  }
44 } //namespace hal
virtual void TearDown()
Definition: hgl_parser.cpp:16
virtual void SetUp()
Definition: hgl_parser.cpp:11
parser
Definition: control.py:13
GateLibrary * get_gate_library(const std::string &file_path)
std::filesystem::path get_base_directory()
Definition: utils.cpp:99
TEST_F(HGLParserTest, check_library)
Definition: hgl_parser.cpp:26