summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2010-10-19 15:52:01 +0200
committerMark Wielaard <mjw@redhat.com>2010-10-19 15:52:01 +0200
commit9b08c6103b45bf986505d1b4eb4dcbab28f14397 (patch)
treefa85168db56645542d6e792007570782b7f76459 /tests
parent1b7590cf13abb03b0e284c555ac61bc4f692e5a4 (diff)
downloadelfutils-9b08c6103b45bf986505d1b4eb4dcbab28f14397.tar.gz
Allow passing through options to dwarf_edit_output test like --offsets.
Diffstat (limited to 'tests')
-rw-r--r--tests/dwarf_edit_output.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/dwarf_edit_output.cc b/tests/dwarf_edit_output.cc
index 135a5a0d..b89bed54 100644
--- a/tests/dwarf_edit_output.cc
+++ b/tests/dwarf_edit_output.cc
@@ -327,27 +327,31 @@ main (int argc, char **argv)
// Test number to run (or all if none given)
int r = 0;
if (argc > 1)
- r = atoi(argv[1]);
+ {
+ r = atoi(argv[1]);
+ argc--;
+ argv++;
+ }
// Whether to print input/output/both [in|out|inout]
show_input = 0;
show_output = 0;
if (argc > 2)
{
- if (strstr (argv[2], "in"))
+ if (strstr (argv[1], "in"))
show_input = 1;
- if (strstr (argv[2], "out"))
+ if (strstr (argv[1], "out"))
show_output = 1;
+ argc--;
+ argv++;
}
if (show_input | show_output)
{
- // Abuse print_die_main initialization, but don't pass real
- // argc/argv since we use those ourselves.
- int dummy_argc = 0;
- char **dummy_argv = NULL;
+ // Abuse print_die_main initialization. Allows adding --offsets.
+ // See print-die.cc for options one can add.
unsigned int d;
- print_die_main (dummy_argc, dummy_argv, d);
+ print_die_main (argc, argv, d);
}
#define RUNTEST(N) (r == 0 || r == N)