diff options
author | Alex White <alex.white@oarcorp.com> | 2021-03-07 22:14:29 -0600 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-03-30 13:15:59 -0500 |
commit | 8ce2cfc917ad385459d8d1570d12c7b753c9926d (patch) | |
tree | c1a90de705d1ce627df1d9b07f70fb48024fbc42 | |
parent | coverage/symbol-sets.ini : Add libtrace (diff) | |
download | rtems-tools-8ce2cfc917ad385459d8d1570d12c7b753c9926d.tar.bz2 |
coverage: Fix option processing on FreeBSD
Covoar uses getopt() to process the command line options. If getopt() is
POSIX-compliant, it will return -1 when it encounters the first
non-option command line argument. It appears that it behaves this way on
FreeBSD, but on Linux getopt() continues to process arguments while
skipping any non-options. This changes the order of arguments passed to
covoar by coverage.py to group all options at the beginning. This allows
hosts with POSIX-compliant getopt() implementations to correctly process
all command line options.
-rw-r--r-- | tester/rt/coverage.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py index a561d26..d88fe04 100644 --- a/tester/rt/coverage.py +++ b/tester/rt/coverage.py @@ -359,10 +359,13 @@ class covoar(object): if not path.exists(symbol_file): raise error.general('coverage: no symbol set file: %s'% (symbol_file)) exe = self._find_covoar() + # The order of these arguments matters. Command line options must come + # before the executable path arguments because covoar uses getopt() to + # process the command line options. command = exe + ' -O ' + covoar_result_dir + \ ' -p ' + self.project_name + \ - ' ' + self.executables + ' ' - command += self.covoar_cmd + ' ' + self.covoar_cmd + ' ' + command += self.executables log.notice() log.notice('Running coverage analysis: %s (%s)' % (set_name, covoar_result_dir)) |