* src/abg-writer.cc (do_indent): New function.
(write_corpus&): Use do_indent. Don't forget to close the
abi-instr tag.
(write_type_decl): Use do_indent. Handle null decls pointers.
Emit the id at the end of the element.
(write_namespace_decl): Use do_indent. Handle null decls
pointers.
* tests/test-utils.{h,cc} (get_src_dir,get_build_dir): Constify
the returned reference to string.
(is_dir, ensure_dir_path_created, ensure_parent_dir_created): New
function definitions.
* tests/test-read-write.cc (main): Augment the test to serialize
the corpus too.
* src/abg-ir.cc (namespace_decl::~namespace_decl): Add this
missing virtual constructor definition.
* src/abg-reader.cc (read_context::{get_cur_decl,pop_decl}):
Return a null pointer when the decls stack is empty.
(update_read_context): Don't try to de-reference a NULL cur_decl.
(read_input): Don't try to poke at file validity here. What was I
thinking. Really test for advance_cursor to return 1, expressing
success.
* src/abg-reader.h (read_file): Fix style.
* Makefile.am: Add tests sub-directory.
* configure.ac: Build with debugging-friendly options if the
ABIGAIL_DEBUG env variable is set. Generate tests/Makefile.
* tests/Makefile.am: New file.
* tests/test-read-write.cc: Likewise.
* tests/test-utils.{h,cc}: Likewise.
* tests/data/test-read-write/input0.xml: Likewise.