It turns out we were wrongly getting the exit code of some processes
being executed by the "system()" invocation. The patch uses the
WIFEXITED and WEXITSTATUS macro as documented in the man page for
"system".
* tests/test-diff-dwarf-abixml.cc (main): Use WIFEXITED and
WEXITSTATUS macros to get the return code of the abidiff program.
* tests/test-diff-filter.cc (test_task::perform): Likewise.
* tests/test-diff-pkg.cc (main): Likewise.
* tests/test-diff-suppr.cc (main): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
We are going to need to speed up more and more tests, and coding directly
with libpthread for that can be tedious and bug-prone. So I devised an
implementation for the worker threads design pattern instead, and used
it to speed up some tests.
* include/Makefile.am: Add the new abg-workers.h to source
distribution.
* include/abg-workers.h: New file.
* src/Makefile.am: Add the new abg-worker.cc to source
distribution.
* src/abg-workers.cc: New file.
* tests/test-utils.cc: Update copyright. Make get_src_dir() and
get_build_dir() return a const char*, as opposed to returning a
string. Make that const char reside in thread local storage, so
that two concurrent threads can safely call these functions in
parallel, without any race.
* tests/test-utils.h: Make get_src_dir() and get_build_dir()
return a const char*, as opposed to returning a string.
* tests/test-abicompat.cc: Update copyright. Adjust for
get_src_dir() and get_build_dir() change.
* tests/test-abidiff.cc: Likewise.
* tests/test-alt-dwarf-file.cc: Likewise.
* tests/test-core-diff.cc: Likewise.
* tests/test-diff-dwarf-abixml.cc: Likewise.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tests/test-lookup-syms.cc: Likewise.
* tests/test-read-dwarf.cc: Likewise.
* tests/test-read-write.cc: Likewise.
* tests/test-types-stability.cc: Likewise. Use the new task queue
type to run these tests in parallel.
* tests/test-diff-filter.cc: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
In the DWARF reader it can happen that a function type being built is
canonicalized too early, before the type is done building. This leads
to some spurious type differences later at comparison time. It
typically happens when a sub-type of the function type refers to the
function type itself. We correctly handle similar cases for class
types, but not for function types. Oops.
This patch handles this case for function types in the dwarf reader
and in the abixml reader.
* src/abg-dwarf-reader.cc (die_function_type_map_type): New
typedef.
* ():
(read_context::die_wip_function_types_map_): New data member.
(read_context::{die_wip_function_types_map,
is_wip_function_type_die_offset}): New methods.
(build_function_type): Mark the function being built as "work in
progress".
(maybe_canonicalize_type): Do not early-canonicalize WIP function
types.
* src/abg-reader.cc (build_function_type): Mark the function being
built as "work in progress".
* tests/test-diff-dwarf-abixml.cc: New test harness.
* tests/Makefile.am: Add new test harness runtestdiffdwarfabixml
to the build system.
* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1:
New test binary input.
* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
New test input.
* tests/data/Makefile.am: Add new test inputs to source
distribution.
* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>