public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@seketeli.org>
To: Guillermo Martinez via Libabigail <libabigail@sourceware.org>
Subject: Re: [PATCH v2] Add regression tests for ctf reading
Date: Thu, 25 Nov 2021 11:40:29 +0100	[thread overview]
Message-ID: <87a6hstt5u.fsf@seketeli.org> (raw)
In-Reply-To: <1748826.RoRjW6BIRr@sali> (Guillermo Martinez via Libabigail's message of "Tue, 23 Nov 2021 18:54:28 +0000")

Guillermo Martinez via Libabigail <libabigail@sourceware.org> a écrit:

[...]

> On Tuesday, November 23, 2021 9:48:35 AM CST Jose E. Marchesi wrote:
>
> Hello Jose/everybody
>
> Thanks for your comments!, answers below:
>
> The following items summarise steps currently implemented in
> the testsuite for DWARF and CTF readers:
>
> 1) Create corpus using the ELF input file, e.g:
>       *src*/libabigail/tests/data/test-read-ctf/test0
>      - In this step the SUTs are: *the front-end and readers*.
>
> 2) Serialize the corpus object to XML ABI description in output
>     directory:
>      *build*/libabigail_x86_64/tests/output/test-read-ctf/test0.abi
>      - SUT: *writter* using write_corpus function

Right.

> (it doesn't use libxml (IMHO something to change if we want to use in
> the future properties, name space, etc).

I am not sure about this, but hey, the future will tell :-)

>
> 3) Spawn *abidw* tool with ELF input file using --abidiff argument, e.g:
>      abidw --abidiff  --ctf *src*/libabigail/tests/data/test-read-ctf/test0
>
>     Internally abiw works as follow:
>      
>    3.1) Create corpus from ELF input file, e.g:
>             *src*/libabigail/tests/data/test-read-ctf/test0
>     - In this step SUTs: *DWARF/CTF frond-end readers*
>
>    3.2) Serialize the (*first*) corpus object to XML ABI description in 
>           *temp* directory:
>              /tmp/libbigail-xyz
>     - SUTs: ABI writter,
>
>    3.3) Build a (*second*) corpus from this temporary file (*same file!*):
>         - SUTs: *XML reader*.
>
>    3.4) Compute the corpus differences
>               compute_diff(corp, corp2 ..)
>      - SUTs: *comparison algorithm* (diff_context/corpus diff)
>
>        if there are differences return 1 otherwise return 0.
>

Right.

> 4) The return value is read by test-read-ctf and if it's 1 test
>     is marked as *FAILED*
>
> 5) Use a external *diff command* to compare the XML abi input file with
>     the file outputted in the step 2. The return code of the diff command
>     is used to mark the test as SUCCESS or FAILED
>
> So, the abidw doesn't use the expected XML file used in the testsuite, so
> if there are changes on the input ELF or in the libabigail subsystems (readers,
> writer, corpus, etc) we could get false negatives, because it is working with
> itself result as an incoming file, instead of use an expected file.

Actually, this won't be a false negative.  It's a true negative. because
what we want to see with abidw --abidiff is that the abixml file that is
emitted has the same *ABI* as the incoming ELF file.  In other words, we
want to see if the DWARF/CTF, the in-memory IR, and the abixml are all
coherent, so to speak.  The exact output details of the XML itself
(things like spaces or order of type definitions etc) don't matter to us
at that point.  We want those insignificant details of the abixml format
to be able to fluctuate without having the fundamentals of ABI
compatibility in general to be impacted.

However, regardless of abidw --abidiff (which cares about stability of
the ABI representation across DWARF/CTF, in-memory IR and abixml), the
test-read-dwarf.cc harness also wants to detect minutes changes to the
abixml that is emitted by abidw.  This is so that developers are forced
to inspect abixml changes that are due to source code modification of
libabigail before submitting their changes.

This is why we use "diff" to compare the emitted abixml against the
expected/reference one If the emitted one is different because of a new
source code change, but the ABI is stable, we'll just accept that new
change and promote the new abidw output as being the new
reference/expected output.

> I think that we should use the ABI XML reader from the expected file (e.g:
> tests/data/test-read-ctf/test0.abi) to build the corpus to be compared
> with the corpus built with ELF input file (e.g: tests/data/test-read-ctf/test0)
> and in this way replace the external abidw and diff command calls,

Heh.  This is exactly what abidw --abidiff does.  And we want to use
abidw too to, so that the *tool* is tested too.
this also

But as I have explained above, we also want to use 'diff' for a
different level of testing.

[...]

> helps to avoid false positives when XML ABIs files has the same nodes but not
> in the same order.


[...]


On Tuesday, November 23, 2021 9:48:35 AM CST Jose E. Marchesi wrote

>> 2) I am surprised by the fact the CTF reader seems to be working as good
>>    as the DWARF reader re. the testsuite.

Well, we don't know that ;-)

To know that, it's needed to *inspect* the result of abidw --ctf on the
binaries and compare it to what we see in the source code of the binary.

We can also introduce new ctf binaries for abidiff-based tests and
compare their output to their DWARF counter part.

There are going to be differences, I am quite sure of that.  But at
least we'll see what they are.  I am not afraid, though.  I think the
CTF support is super cleanly done.  If there are issues, we'll tackle
them.

This testing work is a critical part of that work.  Many thanks to
Guillermo for handling it!

[...]

Cheers,

-- 
		Dodji

  reply	other threads:[~2021-11-25 10:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 22:41 Regression tests for ctf reader: Avoid duplicating files Guillermo Martinez
2021-11-04  8:27 ` Jose E. Marchesi
2021-11-09  2:52   ` Guillermo Martinez
2021-11-09 14:47     ` Dodji Seketeli
2021-11-10 12:06       ` Jose E. Marchesi
2021-11-11 15:16       ` Guillermo Martinez
2021-11-15 13:49 ` [PATCH] Add regression tests for ctf reading Guillermo E. Martinez
2021-11-17  8:33   ` Dodji Seketeli
2021-11-18  4:02     ` Guillermo Martinez
2021-11-18  4:16     ` Guillermo E. Martinez
2021-11-18 13:52       ` Jose E. Marchesi
2021-11-18 15:14         ` Guillermo Martinez
2021-11-22 21:33       ` [PATCH v2] " Guillermo E. Martinez
2021-11-23 15:48         ` Jose E. Marchesi
2021-11-23 18:54           ` Guillermo Martinez
2021-11-25 10:40             ` Dodji Seketeli [this message]
2021-11-25 21:03               ` Guillermo Martinez
2021-11-26 10:02                 ` Dodji Seketeli
2021-11-24 16:36         ` Dodji Seketeli
2021-11-24 18:52           ` Guillermo Martinez
2021-11-26 11:23             ` Dodji Seketeli
2021-11-26 13:01               ` Jose E. Marchesi
2021-11-26 13:37               ` Guillermo Martinez
2021-11-24 19:09           ` Ben Woodard
2021-11-25  0:13             ` Ben Woodard
2021-11-25  6:50             ` Jose E. Marchesi
2021-11-25  9:47               ` Giuliano Procida
2021-12-01  3:18               ` Ben Woodard
2021-11-25  9:34             ` Giuliano Procida
2021-11-25 21:56               ` Ben Woodard
2021-11-26 10:27             ` Dodji Seketeli
2021-12-01  2:13               ` Ben Woodard

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=87a6hstt5u.fsf@seketeli.org \
    --to=dodji@seketeli.org \
    --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).