Commit Graph

6 Commits

Author SHA1 Message Date
14e97e6b25 tests: Add debugedit tests
Copy reduced tests/Makefile.am from RPM upstream and make tests work.
2020-11-10 06:43:20 +03:00
29ac9fc75a tests/debugedit: Uncompress object files before tests
We have in `*.o` `.debug_*` sections compressed by default, thus,
getting `DWARF version 0 unhandled' error.
2020-11-10 06:43:20 +03:00
Jan Kratochvil
068a47d330 debugedit: Fix missing relocation of .debug_types section. 2020-08-12 11:21:13 +03:00
Panu Matilainen
41380d7394 Execute tests in independent testing roots to enable parallel running
Up to now we've run tests in a mish-mash of an environment where bits
and pieces of previous tests might exist, and as state has been shared
it's been impossible to execute tests in parallel.

This makes the pre-populated testing-root read-only to the owner to force
all writers to perform an extra setup call to gain a private testing
environment. Most of the users needing this already had RPMDB_INIT calls
to ensure clean rpmdb state so that's where this is hooked onto.

There's a fair bit of gymnastics with the environment to make things match
on both sides of fakechroot, some of which can hopefully go away eventually
once the dust from this settles. This is also rather heavy as it is,
on my laptop serial execution goes down from ~1m15s to ~1m45s, but then
parallel execution with -j8 is down to ~50s. There should be a number of
optimizations that can be made, such as setting up links for writable
directories instead of copying the entire testing-tree around, but leaving
that as a future exercise. This is more of an enabler than the goal state.

Note that this does *not* enable test-suite parallel running for
`make -jN check`, because `make` does not export the -j argument in
a way that we could pass to `./rpmtests` from the makefile. To enable
that, one needs to pass a suitable -jN argument through TESTSUITEFLAGS,
such as `make -j8 check TESTSUITEFLAGS="-j8"`. Or run invoke `rpmtests`
manually.
2020-06-12 13:18:56 +03:00
Mark Wielaard
a78871c0bc Handle .debug_macro in debugedit.
When compiling with -g3 gcc will generate a .debug_macro section
which has pointers to the .debug_str section. Since we might rewrite
the .debug_str section, we also need to update any .debug_macro
pointers.

Updated the debugedit.at testcase by building everything with -g
and add various checks to see the .debug_macro section looks OK
after running debugedit. Added a new rpmbuild.at testcase to check
handing of .debug_macro in the whole rpmbuild debuginfo pipeline
to double check the separate .debug file also contains the macros.

Original patch by Michael Schroeder <mls@suse.de>. Extended by
Mark Wielaard <mark@klomp.org> to deal with relocations and possible
multiple COMDAT .debug_macro sections.
2019-06-19 15:06:55 +03:00
Mark Wielaard
ab0b014eaa Add some debugedit tests.
debugedit didn't have any direct tests, it was only tested indirectly
through some other debuginfo testcases.  So add some testcases that
just test debugedit functionality directly.

The tests create different kinds of ELF files (object files, partially
linked files and executables) and run debugedit path replacements on
them, checking that the resulting .debug_str, .debug_info and .debug_line
sections look sane.

Testcases verified against various different gcc and binutils versions.
gcc 4.8 and gcc 6 generate slightly different .debuginfo

Also add debugedit --version. Which makes it easy to see we are
testing the correct version/install of debugedit in rpmtests.log.

Adjust autotest paths to include rpmlibexecdir, where debuginfo
is installed.  Note that rpmlibexecdir != libexecdir (see rpm.am).
2019-06-19 15:06:55 +03:00