]> sourceware.org Git - libabigail.git/commit
abicompat: Fix exit code in weak mode
authorDodji Seketeli <dodji@redhat.com>
Fri, 15 Mar 2024 16:03:14 +0000 (17:03 +0100)
committerDodji Seketeli <dodji@redhat.com>
Fri, 15 Mar 2024 19:22:17 +0000 (20:22 +0100)
commit3b1cf8e032a6ec11c7ab8c5d0b792786726c1584
tree159e4ca84487ff7c028ef4ebb6ce2980af740dce
parent15f2ff5d6c35485f05587312a6e3a582ba906233
abicompat: Fix exit code in weak mode

It turns out the tool is almost always returning ABIDIFF_OK in weak
mode.  Oops.  Fixed thus.  Also, update the test-abicompat.cc to test
for expected exit codes to catch this kind of regressions in the
future.

* tools/abicompat.cc (perform_compat_check_in_weak_mode): Do not
override the status code when doing the comparison in the reverse
direction.
(compare_expected_against_provided_functions)
(compare_expected_against_provided_variables): Set the status code
close to the detected diff.  In the future, this might help us
provide finer grained status.
* tests/test-abicompat.cc (InOutSpec::status): Add a new data
member to represent the expected exit code.
(in_out_specs): Adjust the array of tests.
(main): If the actual exit code is different from the expected
one, then the test failed so let's report it.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
tests/test-abicompat.cc
tools/abicompat.cc
This page took 0.033672 seconds and 5 git commands to generate.