libabigail/tests/data/test-abidiff-exit/test-leaf-redundant-v1.c

23 lines
369 B
C
Raw Normal View History

abidiff: Document and refresh tests. Following on from giving some test file more descriptive names, this patch actually documents in brief the purpose of these recently added tests. It also improves the coverage of the test-leaf-cxx-members test to include deletion and insertion report text as well. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.cc: Comment test. Reorder members of ops to get better coverage. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.cc: Comment test. * tests/data/test-abidiff-exit/test-leaf-more-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Comment test. Update comment on ops2. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.c: Comment test. * tests/data/test-abidiff-exit/test-leaf-stats-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-report.txt: Update locations. Update report to reflect deletion, insertion and changed members (was previously changed only).: * tests/data/test-abidiff-exit/test-leaf-peeling-report.txt: Update locations. * tests/data/test-abidiff-exit/test-leaf-redundant-report.txt: Ditto.: * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.cc: Added one line comment referring to -v1 source file. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.o: Recompiled. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v1.o: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-04-08 12:20:44 +00:00
// Ensure that --redundant is indeed implied by --leaf-changes-only mode and
// that all the changed functions get complete reports.
Fix interaction of --redundant and --leaf-changes-only options. The --redundant (meaning show-redundant-changes) option is supposed to be implied by --leaf-changes-only and this is currently implemented by making diff_context's --leaf-changes-only setter also duplicate the behaviour of its --redundant setter. In both abidiff and abipkgdiff, the diff_context setters are called unconditionally, but the relative order of the calls for these two options is different in each case, resulting in two different issues. In abidiff, the --redundant setter is called second, undoing the intended side-effect of any --leaf-changes-only flag. So --redundant is not actually turned on in --leaf-changes-only mode unless requested explicitly. In abipkgdiff, the leaf-changes-only setter is called second, undoing (in non-leaf mode) the effect of any --redundant flag. So --redundant has no effect in default reporting mode. The fix is move to move the "--leaf-changes-only implies --redundant" logic from the setter to the set_diff_context_from_opts functions. This patch also documents the implied behaviour in the usage strings. * src/abg-comparison.cc (diff_context::show_leaf_changes_only): Remove "--leaf-changes-only implies --redundant" logic. * tools/abidiff.cc (display_usage): Mention that --leaf-changes-only implies --redundant. (set_diff_context_from_opts): Make --leaf-changes-only imply --redundant; document this behaviour in a comment. * tools/abipkgdiff.cc: Ditto. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-leaf3-report.txt: Add new test case, to show --leaf-changes-only implies --redundant. * tests/data/test-abidiff-exit/test-leaf3-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test case. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Update abipkgdiff report with --redundant output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Ditto. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-03-12 06:30:32 +00:00
struct stn1 {
int x;
};
struct stn2 {
long x;
double y;
};
abidiff: Document and refresh tests. Following on from giving some test file more descriptive names, this patch actually documents in brief the purpose of these recently added tests. It also improves the coverage of the test-leaf-cxx-members test to include deletion and insertion report text as well. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.cc: Comment test. Reorder members of ops to get better coverage. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.cc: Comment test. * tests/data/test-abidiff-exit/test-leaf-more-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Comment test. Update comment on ops2. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.c: Comment test. * tests/data/test-abidiff-exit/test-leaf-stats-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-report.txt: Update locations. Update report to reflect deletion, insertion and changed members (was previously changed only).: * tests/data/test-abidiff-exit/test-leaf-peeling-report.txt: Update locations. * tests/data/test-abidiff-exit/test-leaf-redundant-report.txt: Ditto.: * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.cc: Added one line comment referring to -v1 source file. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.o: Recompiled. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v1.o: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-04-08 12:20:44 +00:00
void fn1(struct stn1 s) { // was sto1
Fix interaction of --redundant and --leaf-changes-only options. The --redundant (meaning show-redundant-changes) option is supposed to be implied by --leaf-changes-only and this is currently implemented by making diff_context's --leaf-changes-only setter also duplicate the behaviour of its --redundant setter. In both abidiff and abipkgdiff, the diff_context setters are called unconditionally, but the relative order of the calls for these two options is different in each case, resulting in two different issues. In abidiff, the --redundant setter is called second, undoing the intended side-effect of any --leaf-changes-only flag. So --redundant is not actually turned on in --leaf-changes-only mode unless requested explicitly. In abipkgdiff, the leaf-changes-only setter is called second, undoing (in non-leaf mode) the effect of any --redundant flag. So --redundant has no effect in default reporting mode. The fix is move to move the "--leaf-changes-only implies --redundant" logic from the setter to the set_diff_context_from_opts functions. This patch also documents the implied behaviour in the usage strings. * src/abg-comparison.cc (diff_context::show_leaf_changes_only): Remove "--leaf-changes-only implies --redundant" logic. * tools/abidiff.cc (display_usage): Mention that --leaf-changes-only implies --redundant. (set_diff_context_from_opts): Make --leaf-changes-only imply --redundant; document this behaviour in a comment. * tools/abipkgdiff.cc: Ditto. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-leaf3-report.txt: Add new test case, to show --leaf-changes-only implies --redundant. * tests/data/test-abidiff-exit/test-leaf3-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test case. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Update abipkgdiff report with --redundant output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Ditto. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-03-12 06:30:32 +00:00
}
abidiff: Document and refresh tests. Following on from giving some test file more descriptive names, this patch actually documents in brief the purpose of these recently added tests. It also improves the coverage of the test-leaf-cxx-members test to include deletion and insertion report text as well. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.cc: Comment test. Reorder members of ops to get better coverage. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.cc: Comment test. * tests/data/test-abidiff-exit/test-leaf-more-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Comment test. Update comment on ops2. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.c: Comment test. * tests/data/test-abidiff-exit/test-leaf-stats-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-report.txt: Update locations. Update report to reflect deletion, insertion and changed members (was previously changed only).: * tests/data/test-abidiff-exit/test-leaf-peeling-report.txt: Update locations. * tests/data/test-abidiff-exit/test-leaf-redundant-report.txt: Ditto.: * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.cc: Added one line comment referring to -v1 source file. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.o: Recompiled. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v1.o: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-04-08 12:20:44 +00:00
void fn2(struct stn2 s) { // was sto2
Fix interaction of --redundant and --leaf-changes-only options. The --redundant (meaning show-redundant-changes) option is supposed to be implied by --leaf-changes-only and this is currently implemented by making diff_context's --leaf-changes-only setter also duplicate the behaviour of its --redundant setter. In both abidiff and abipkgdiff, the diff_context setters are called unconditionally, but the relative order of the calls for these two options is different in each case, resulting in two different issues. In abidiff, the --redundant setter is called second, undoing the intended side-effect of any --leaf-changes-only flag. So --redundant is not actually turned on in --leaf-changes-only mode unless requested explicitly. In abipkgdiff, the leaf-changes-only setter is called second, undoing (in non-leaf mode) the effect of any --redundant flag. So --redundant has no effect in default reporting mode. The fix is move to move the "--leaf-changes-only implies --redundant" logic from the setter to the set_diff_context_from_opts functions. This patch also documents the implied behaviour in the usage strings. * src/abg-comparison.cc (diff_context::show_leaf_changes_only): Remove "--leaf-changes-only implies --redundant" logic. * tools/abidiff.cc (display_usage): Mention that --leaf-changes-only implies --redundant. (set_diff_context_from_opts): Make --leaf-changes-only imply --redundant; document this behaviour in a comment. * tools/abipkgdiff.cc: Ditto. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-leaf3-report.txt: Add new test case, to show --leaf-changes-only implies --redundant. * tests/data/test-abidiff-exit/test-leaf3-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test case. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Update abipkgdiff report with --redundant output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Ditto. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-03-12 06:30:32 +00:00
}
abidiff: Document and refresh tests. Following on from giving some test file more descriptive names, this patch actually documents in brief the purpose of these recently added tests. It also improves the coverage of the test-leaf-cxx-members test to include deletion and insertion report text as well. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.cc: Comment test. Reorder members of ops to get better coverage. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.cc: Comment test. * tests/data/test-abidiff-exit/test-leaf-more-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Comment test. Update comment on ops2. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.c: Comment test. * tests/data/test-abidiff-exit/test-leaf-stats-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-report.txt: Update locations. Update report to reflect deletion, insertion and changed members (was previously changed only).: * tests/data/test-abidiff-exit/test-leaf-peeling-report.txt: Update locations. * tests/data/test-abidiff-exit/test-leaf-redundant-report.txt: Ditto.: * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.cc: Added one line comment referring to -v1 source file. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.o: Recompiled. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v1.o: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-04-08 12:20:44 +00:00
void fn3(struct stn1* s) { // was sto1
Fix interaction of --redundant and --leaf-changes-only options. The --redundant (meaning show-redundant-changes) option is supposed to be implied by --leaf-changes-only and this is currently implemented by making diff_context's --leaf-changes-only setter also duplicate the behaviour of its --redundant setter. In both abidiff and abipkgdiff, the diff_context setters are called unconditionally, but the relative order of the calls for these two options is different in each case, resulting in two different issues. In abidiff, the --redundant setter is called second, undoing the intended side-effect of any --leaf-changes-only flag. So --redundant is not actually turned on in --leaf-changes-only mode unless requested explicitly. In abipkgdiff, the leaf-changes-only setter is called second, undoing (in non-leaf mode) the effect of any --redundant flag. So --redundant has no effect in default reporting mode. The fix is move to move the "--leaf-changes-only implies --redundant" logic from the setter to the set_diff_context_from_opts functions. This patch also documents the implied behaviour in the usage strings. * src/abg-comparison.cc (diff_context::show_leaf_changes_only): Remove "--leaf-changes-only implies --redundant" logic. * tools/abidiff.cc (display_usage): Mention that --leaf-changes-only implies --redundant. (set_diff_context_from_opts): Make --leaf-changes-only imply --redundant; document this behaviour in a comment. * tools/abipkgdiff.cc: Ditto. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-leaf3-report.txt: Add new test case, to show --leaf-changes-only implies --redundant. * tests/data/test-abidiff-exit/test-leaf3-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test case. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Update abipkgdiff report with --redundant output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Ditto. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-03-12 06:30:32 +00:00
}
abidiff: Document and refresh tests. Following on from giving some test file more descriptive names, this patch actually documents in brief the purpose of these recently added tests. It also improves the coverage of the test-leaf-cxx-members test to include deletion and insertion report text as well. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.cc: Comment test. Reorder members of ops to get better coverage. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.cc: Comment test. * tests/data/test-abidiff-exit/test-leaf-more-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Comment test. Update comment on ops2. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.c: Comment test. * tests/data/test-abidiff-exit/test-leaf-stats-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-report.txt: Update locations. Update report to reflect deletion, insertion and changed members (was previously changed only).: * tests/data/test-abidiff-exit/test-leaf-peeling-report.txt: Update locations. * tests/data/test-abidiff-exit/test-leaf-redundant-report.txt: Ditto.: * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.cc: Added one line comment referring to -v1 source file. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v0.o: Recompiled. * tests/data/test-abidiff-exit/test-leaf-cxx-members-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-fun-type-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-more-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-redundant-v1.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf-stats-v1.o: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-04-08 12:20:44 +00:00
void fn4(struct stn2* s) { // was sto2
Fix interaction of --redundant and --leaf-changes-only options. The --redundant (meaning show-redundant-changes) option is supposed to be implied by --leaf-changes-only and this is currently implemented by making diff_context's --leaf-changes-only setter also duplicate the behaviour of its --redundant setter. In both abidiff and abipkgdiff, the diff_context setters are called unconditionally, but the relative order of the calls for these two options is different in each case, resulting in two different issues. In abidiff, the --redundant setter is called second, undoing the intended side-effect of any --leaf-changes-only flag. So --redundant is not actually turned on in --leaf-changes-only mode unless requested explicitly. In abipkgdiff, the leaf-changes-only setter is called second, undoing (in non-leaf mode) the effect of any --redundant flag. So --redundant has no effect in default reporting mode. The fix is move to move the "--leaf-changes-only implies --redundant" logic from the setter to the set_diff_context_from_opts functions. This patch also documents the implied behaviour in the usage strings. * src/abg-comparison.cc (diff_context::show_leaf_changes_only): Remove "--leaf-changes-only implies --redundant" logic. * tools/abidiff.cc (display_usage): Mention that --leaf-changes-only implies --redundant. (set_diff_context_from_opts): Make --leaf-changes-only imply --redundant; document this behaviour in a comment. * tools/abipkgdiff.cc: Ditto. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-leaf3-report.txt: Add new test case, to show --leaf-changes-only implies --redundant. * tests/data/test-abidiff-exit/test-leaf3-v0.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v0.o: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.c: Ditto. * tests/data/test-abidiff-exit/test-leaf3-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test case. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Update abipkgdiff report with --redundant output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Ditto. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-03-12 06:30:32 +00:00
}