mirror of
https://git.rtems.org/rtems-tools/
synced 2025-07-04 15:24:01 +08:00
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.
This commit is contained in:
parent
aca2df5c84
commit
8ce2cfc917
@ -359,10 +359,13 @@ class covoar(object):
|
|||||||
if not path.exists(symbol_file):
|
if not path.exists(symbol_file):
|
||||||
raise error.general('coverage: no symbol set file: %s'% (symbol_file))
|
raise error.general('coverage: no symbol set file: %s'% (symbol_file))
|
||||||
exe = self._find_covoar()
|
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 + \
|
command = exe + ' -O ' + covoar_result_dir + \
|
||||||
' -p ' + self.project_name + \
|
' -p ' + self.project_name + \
|
||||||
' ' + self.executables + ' '
|
' ' + self.covoar_cmd + ' '
|
||||||
command += self.covoar_cmd
|
command += self.executables
|
||||||
|
|
||||||
log.notice()
|
log.notice()
|
||||||
log.notice('Running coverage analysis: %s (%s)' % (set_name, covoar_result_dir))
|
log.notice('Running coverage analysis: %s (%s)' % (set_name, covoar_result_dir))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user