diff mbox series

[04/20] dwarf-reader split: create abg-symtab-reader.{h, cc} and test case

Message ID 20210127125853.886677-5-maennich@google.com
State New
Headers show
Series Refactor (k)symtab reader | expand

Commit Message

Matthias Maennich Jan. 27, 2021, 12:58 p.m. UTC
abg-symtab-reader.{h,cc} shall contain the refactored symtab reader.
Create the stub files, an empty unit test and hook everything up in the
make system.

    * src/abg-symtab-reader.h: New header file.
    * src/abg-symtab-reader.cc: New source file.
    * src/Makefile.am: Add new source files.
    * tests/Makefile.am: Add new test case runtestsymtabreader.
    * tests/test-symtab-reader.cc: New test source file.

Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
---
 src/Makefile.am             |  2 ++
 src/abg-symtab-reader.cc    | 21 +++++++++++++++++++++
 src/abg-symtab-reader.h     | 24 ++++++++++++++++++++++++
 tests/Makefile.am           |  4 ++++
 tests/test-symtab-reader.cc | 15 +++++++++++++++
 5 files changed, 66 insertions(+)
 create mode 100644 src/abg-symtab-reader.cc
 create mode 100644 src/abg-symtab-reader.h
 create mode 100644 tests/test-symtab-reader.cc
diff mbox series

Patch

diff --git a/src/Makefile.am b/src/Makefile.am
index 26fc4d1566ca..86877635be03 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -38,6 +38,8 @@  abg-tools-utils.cc			\
 abg-elf-helpers.h			\
 abg-elf-helpers.cc			\
 abg-regex.cc				\
+abg-symtab-reader.h			\
+abg-symtab-reader.cc			\
 $(VIZ_SOURCES)
 
 libabigail_la_LIBADD = $(DEPS_LIBS)
diff --git a/src/abg-symtab-reader.cc b/src/abg-symtab-reader.cc
new file mode 100644
index 000000000000..a6c8ca0ef548
--- /dev/null
+++ b/src/abg-symtab-reader.cc
@@ -0,0 +1,21 @@ 
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+// -*- Mode: C++ -*-
+//
+// Copyright (C) 2020 Google, Inc.
+//
+// Author: Matthias Maennich
+
+/// @file
+///
+/// This contains the definition of the symtab reader
+
+#include "abg-symtab-reader.h"
+
+namespace abigail
+{
+
+namespace symtab_reader
+{
+
+} // end namespace symtab_reader
+} // end namespace abigail
diff --git a/src/abg-symtab-reader.h b/src/abg-symtab-reader.h
new file mode 100644
index 000000000000..a929166b83ef
--- /dev/null
+++ b/src/abg-symtab-reader.h
@@ -0,0 +1,24 @@ 
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+// -*- Mode: C++ -*-
+//
+// Copyright (C) 2020 Google, Inc.
+//
+// Author: Matthias Maennich
+
+/// @file
+///
+/// This contains the declarations for the symtab reader.
+
+#ifndef __ABG_SYMTAB_READER_H__
+#define __ABG_SYMTAB_READER_H__
+
+namespace abigail
+{
+
+namespace symtab_reader
+{
+
+} // end namespace symtab_reader
+} // end namespace abigail
+
+#endif // __ABG_SYMTAB_READER_H__
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 655facb19ec1..533cc23680ce 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -46,6 +46,7 @@  runtestkmiwhitelist		\
 runtestlookupsyms		\
 runtestreadwrite		\
 runtestsymtab			\
+runtestsymtabreader		\
 runtesttoolsutils		\
 runtestsvg			\
 $(FEDABIPKGDIFF_TEST) 		\
@@ -156,6 +157,9 @@  runtestcxxcompat_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
 runtestsymtab_SOURCES = test-symtab.cc
 runtestsymtab_LDADD = libtestutils.la libcatch.la $(top_builddir)/src/libabigail.la
 
+runtestsymtabreader_SOURCES = test-symtab-reader.cc
+runtestsymtabreader_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
+
 runtestsvg_SOURCES=test-svg.cc
 runtestsvg_LDADD=$(top_builddir)/src/libabigail.la
 
diff --git a/tests/test-symtab-reader.cc b/tests/test-symtab-reader.cc
new file mode 100644
index 000000000000..1bd37572f4d7
--- /dev/null
+++ b/tests/test-symtab-reader.cc
@@ -0,0 +1,15 @@ 
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+// -*- Mode: C++ -*-
+//
+// Copyright (C) 2020 Google, Inc.
+//
+// Author: Matthias Maennich
+
+/// @file
+///
+/// This program tests libabigail's symtab reader.
+
+#include "lib/catch.hpp"
+
+#include "abg-symtab-reader.h"
+