public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com
Subject: [PATCH 2/2] abg-writer.cc: Fix indentation of XML output
Date: Thu, 16 Jul 2020 18:33:32 +0100	[thread overview]
Message-ID: <20200716173332.3926122-2-gprocida@google.com> (raw)
In-Reply-To: <20200716173332.3926122-1-gprocida@google.com>

The XML writer produces valid XML. However, it differs in a few
respects from that obtained with xmllint --format.

- there is no XML declaration at the start
- attributes use single quotes rather than double quotes
- indentation is mostly 2 spaces but this is broken in places

This commit fixes the last of these issues as it actually causes
readability issues when examining diffs. It also does this for every
test XML file, whether used as input, compared against output or not
used at all, to match what xmllint --format would do.

	* src/abg-writer.cc (write_canonical_types_of_scope): Do not
	add additional indentation. (write_translation_unit): Pass
	additional indentation to write_canonical_types_of_scope.
	(write_class_decl): Ensure optional annotations of base
	classes have the same indentation as the base classes
	themselves.
	* tests/data/test-annotate/libtest23.so.abi: Fix indentation.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Ditto.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Ditto.
	* tests/data/test-annotate/test-anonymous-members-0.o.abi:
	Ditto.
	* tests/data/test-annotate/test1.abi: Ditto.
	* tests/data/test-annotate/test14-pr18893.so.abi: Ditto.
	* tests/data/test-annotate/test15-pr18892.so.abi: Ditto.
	* tests/data/test-annotate/test17-pr19027.so.abi: Ditto.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Ditto.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Ditto.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Ditto.
	* tests/data/test-annotate/test21-pr19092.so.abi: Ditto.
	* tests/data/test-diff-suppr/test45-abi-wl.xml: Ditto.
	* tests/data/test-diff-suppr/test45-abi.xml: Ditto.
	* tests/data/test-diff-suppr/test46-PR25128-base.xml: Ditto.
	* tests/data/test-diff-suppr/test46-PR25128-new.xml: Ditto.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	Ditto.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Ditto.
	* tests/data/test-read-dwarf/libtest23.so.abi: Ditto.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi:
	Ditto.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Ditto.
	* tests/data/test-read-dwarf/test1.abi: Ditto.
	* tests/data/test-read-dwarf/test1.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Ditto.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Ditto.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Ditto.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Ditto.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Ditto.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Ditto.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Ditto.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Ditto.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Ditto.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Ditto.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Ditto.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Ditto.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Ditto.
	* tests/data/test-read-write/test10.xml: Ditto.
	* tests/data/test-read-write/test15.xml: Ditto.
	* tests/data/test-read-write/test21.xml: Ditto.
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Ditto.
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Ditto.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-writer.cc                             |   10 +-
 tests/data/test-annotate/libtest23.so.abi     |  176 +-
 .../test-annotate/libtest24-drop-fns-2.so.abi |  554 +-
 .../test-annotate/libtest24-drop-fns.so.abi   |  554 +-
 .../test-anonymous-members-0.o.abi            |  154 +-
 tests/data/test-annotate/test1.abi            |   20 +-
 .../data/test-annotate/test14-pr18893.so.abi  |  180 +-
 .../data/test-annotate/test15-pr18892.so.abi  | 1046 +-
 .../data/test-annotate/test17-pr19027.so.abi  | 3552 +++----
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 2168 ++--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi | 5324 +++++-----
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 2308 ++---
 .../data/test-annotate/test21-pr19092.so.abi  |  306 +-
 tests/data/test-diff-suppr/test45-abi-wl.xml  |  392 +-
 tests/data/test-diff-suppr/test45-abi.xml     |  574 +-
 .../test-diff-suppr/test46-PR25128-base.xml   |  574 +-
 .../test-diff-suppr/test46-PR25128-new.xml    |  574 +-
 .../PR22015-libboost_iostreams.so.abi         |  230 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    |  498 +-
 tests/data/test-read-dwarf/libtest23.so.abi   |  132 +-
 .../libtest24-drop-fns-2.so.abi               |  386 +-
 .../test-read-dwarf/libtest24-drop-fns.so.abi |  198 +-
 tests/data/test-read-dwarf/test1.abi          |   12 +-
 tests/data/test-read-dwarf/test1.hash.abi     |   12 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi | 1670 ++--
 .../test-read-dwarf/test11-pr18828.so.abi     | 7988 +++++++--------
 .../test-read-dwarf/test12-pr18844.so.abi     | 8674 ++++++++--------
 .../test-read-dwarf/test14-pr18893.so.abi     |  100 +-
 .../test-read-dwarf/test15-pr18892.so.abi     |  770 +-
 .../test-read-dwarf/test16-pr18904.so.abi     | 8800 ++++++++---------
 .../test-read-dwarf/test17-pr19027.so.abi     | 2468 ++---
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 1492 +--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi | 3838 +++----
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 1554 +--
 .../test-read-dwarf/test21-pr19092.so.abi     |  234 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 7834 +++++++--------
 .../test9-pr18818-clang.so.abi                | 1126 +--
 tests/data/test-read-write/test10.xml         |    6 +-
 tests/data/test-read-write/test15.xml         |    6 +-
 tests/data/test-read-write/test21.xml         |    6 +-
 .../test28-without-std-fns-ref.xml            |  172 +-
 .../test28-without-std-vars-ref.xml           |  160 +-
 42 files changed, 33415 insertions(+), 33417 deletions(-)


Large diff omitted inline, see
https://github.com/myxoid/libabigail/commit/aa481f6e7f2387007657c2923149a855e88212f4

  reply	other threads:[~2020-07-16 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 17:33 [PATCH 1/2] Remove ABI XML test data file blank lines Giuliano Procida
2020-07-16 17:33 ` Giuliano Procida [this message]
2020-07-28 15:08   ` [PATCH 2/2] abg-writer.cc: Fix indentation of XML output Dodji Seketeli
2020-07-28 14:22 ` [PATCH 1/2] Remove ABI XML test data file blank lines Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716173332.3926122-2-gprocida@google.com \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).