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).
This commit is contained in:
parent
9f6127af4d
commit
83e6accd81
@ -88,6 +88,8 @@ int do_build_id = 0;
|
||||
int no_recompute_build_id = 0;
|
||||
char *build_id_seed = NULL;
|
||||
|
||||
int show_version = 0;
|
||||
|
||||
/* We go over the debug sections in two phases. In phase zero we keep
|
||||
track of any needed changes and collect strings, indexes and
|
||||
sizes. In phase one we do the actual replacements updating the
|
||||
@ -2291,6 +2293,8 @@ static struct poptOption optionsTable[] = {
|
||||
"if recomputing the build ID note use this string as hash seed", NULL },
|
||||
{ "no-recompute-build-id", 'n', POPT_ARG_NONE, &no_recompute_build_id, 0,
|
||||
"do not recompute build ID note even when -i or -s are given", NULL },
|
||||
{ "version", '\0', POPT_ARG_NONE, &show_version, 0,
|
||||
"print the debugedit version", NULL },
|
||||
POPT_AUTOHELP
|
||||
{ NULL, 0, 0, NULL, 0, NULL, NULL }
|
||||
};
|
||||
@ -2527,6 +2531,12 @@ main (int argc, char *argv[])
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (show_version)
|
||||
{
|
||||
printf("RPM debugedit %s\n", VERSION);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
args = poptGetArgs (optCon);
|
||||
if (args == NULL || args[0] == NULL || args[1] != NULL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user