[PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
Add support in tester to run covoar and generate an html report to display
the summary of the coverage reports generated from covoar.

Co-authored-by : Cillian O'Donnell 
---
 tester/rt/coverage.py | 379 ++
 tester/rt/test.py |  36 ++-
 tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
 tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
 tester/rtems/testing/qemu.cfg |   4 +-
 5 files changed, 446 insertions(+), 12 deletions(-)
 create mode 100644 tester/rt/coverage.py
 create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini

diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
new file mode 100644
index 000..25fbb9d
--- /dev/null
+++ b/tester/rt/coverage.py
@@ -0,0 +1,379 @@
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+from rtemstoolkit import error
+from rtemstoolkit import path
+from rtemstoolkit import log
+from rtemstoolkit import execute
+from rtemstoolkit import macros
+
+from datetime import datetime
+
+from . import options
+
+import shutil
+import os
+
+try:
+import configparser
+except:
+import ConfigParser as configparser
+
+class summary:
+def __init__(self, p_summary_dir):
+self.summary_file_path = path.join(p_summary_dir, 'summary.txt')
+self.index_file_path = path.join(p_summary_dir, 'index.html')
+self.bytes_analyzed = 0
+self.bytes_not_executed = 0
+self.percentage_executed = 0.0
+self.percentage_not_executed = 100.0
+self.ranges_uncovered = 0
+self.branches_uncovered = 0
+self.branches_total = 0
+self.branches_always_taken = 0
+self.branches_never_taken = 0
+self.percentage_branches_covered = 0.0
+self.is_failure = False
+
+def parse(self):
+if(not path.exists(self.summary_file_path)):
+log.notice('summary file %s does not exist!' % 
(self.summary_file_path))
+self.is_failure = True
+return
+
+with open(self.summary_file_path,'r') as summary_file:
+   self.bytes_analyzed = self._get_next_with_colon(summary_file)
+   self.bytes_not_executed = self._get_next_with_colon(summary_file)
+   self.percentage_executed = self._get_next_with_colon(summary_file)
+   self.percentage_not_executed = 
self._get_next_with_colon(summary_file)
+   self.ranges_uncovered = self._get_next_with_colon(summary_file)
+   self.branches_total = self._get_next_with_colon(summary_file)
+   self.branches_uncovered = self._get_next_with_colon(summary_file)
+   self.branches_always_taken = 
self._get_next_without_colon(summary_file)
+   self.branches_never_taken = 
self._get_next_without_colon(summary_file)
+if len(self.branches_uncovered) > 0 and len(self.branches_total) > 0:
+self.percentage_branches_covered = \
+1 - (float(self.branches_uncovered) / float(self.branches_total))
+else:
+self.percentage_branches_covered = 0.0
+return
+
+def _get_next_with_colon(self, summary_file):
+line = summary_file.readline()
+if ':' in line:
+return line.split(':')[1].strip()
+else:
+return ''
+
+def _get_next_without_colon(self, summary_file):
+line = summary_file.readline()
+return line.strip().split(' ')[0]
+
+class report_gen_html:
+def __init__(self, p_symbol_sets_list, build_dir, rtdir):
+ 

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Cillian O'Donnell
On 31 May 2018 at 19:07, Vijay Kumar Banerjee 
wrote:

> Add support in tester to run covoar and generate an html report to display
> the summary of the coverage reports generated from covoar.
>
> Co-authored-by : Cillian O'Donnell 
> ---
>  tester/rt/coverage.py | 379
> ++
>  tester/rt/test.py |  36 ++-
>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>  tester/rtems/testing/qemu.cfg |   4 +-
>  5 files changed, 446 insertions(+), 12 deletions(-)
>  create mode 100644 tester/rt/coverage.py
>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
>
> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> new file mode 100644
> index 000..25fbb9d
> --- /dev/null
> +++ b/tester/rt/coverage.py
> @@ -0,0 +1,379 @@
> +#
> +# RTEMS Tools Project (http://www.rtems.org/)
> +# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com)
> +# All rights reserved.
> +#
> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions are
> met:
> +#
> +# 1. Redistributions of source code must retain the above copyright
> notice,
> +# this list of conditions and the following disclaimer.
> +#
> +# 2. Redistributions in binary form must reproduce the above copyright
> notice,
> +# this list of conditions and the following disclaimer in the
> documentation
> +# and/or other materials provided with the distribution.
> +#
> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS
> IS'
> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
> THE
> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> PURPOSE
> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
> BE
> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
> THE
> +# POSSIBILITY OF SUCH DAMAGE.
> +#
> +
> +from rtemstoolkit import error
> +from rtemstoolkit import path
> +from rtemstoolkit import log
> +from rtemstoolkit import execute
> +from rtemstoolkit import macros
> +
> +from datetime import datetime
> +
> +from . import options
> +
> +import shutil
> +import os
> +
> +try:
> +import configparser
> +except:
> +import ConfigParser as configparser
> +
> +class summary:
> +def __init__(self, p_summary_dir):
> +self.summary_file_path = path.join(p_summary_dir, 'summary.txt')
> +self.index_file_path = path.join(p_summary_dir, 'index.html')
> +self.bytes_analyzed = 0
> +self.bytes_not_executed = 0
> +self.percentage_executed = 0.0
> +self.percentage_not_executed = 100.0
> +self.ranges_uncovered = 0
> +self.branches_uncovered = 0
> +self.branches_total = 0
> +self.branches_always_taken = 0
> +self.branches_never_taken = 0
> +self.percentage_branches_covered = 0.0
> +self.is_failure = False
> +
> +def parse(self):
> +if(not path.exists(self.summary_file_path)):
> +log.notice('summary file %s does not exist!' %
> (self.summary_file_path))
> +self.is_failure = True
> +return
> +
> +with open(self.summary_file_path,'r') as summary_file:
> +   self.bytes_analyzed = self._get_next_with_colon(summary_file)
> +   self.bytes_not_executed = self._get_next_with_colon(
> summary_file)
> +   self.percentage_executed = self._get_next_with_colon(
> summary_file)
> +   self.percentage_not_executed = self._get_next_with_colon(
> summary_file)
> +   self.ranges_uncovered = self._get_next_with_colon(
> summary_file)
> +   self.branches_total = self._get_next_with_colon(summary_file)
> +   self.branches_uncovered = self._get_next_with_colon(
> summary_file)
> +   self.branches_always_taken = self._get_next_without_colon(
> summary_file)
> +   self.branches_never_taken = self._get_next_without_colon(
> summary_file)
> +if len(self.branches_uncovered) > 0 and len(self.branches_total)
> > 0:
> +self.percentage_branches_covered = \
> +1 - (float(self.branches_uncovered) /
> float(self.branches_total))
> +else:
> +self.percentage_branches_covered = 0.0
> +return
> +
> +def _get_next_with_colon(self, summary_file):
> +line = summary_file.readline()
> +if ':' in line:

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On 1 June 2018 at 01:07, Cillian O'Donnell  wrote:

>
>
> On 31 May 2018 at 19:07, Vijay Kumar Banerjee 
> wrote:
>
>> Add support in tester to run covoar and generate an html report to display
>> the summary of the coverage reports generated from covoar.
>>
>> Co-authored-by : Cillian O'Donnell 
>> ---
>>  tester/rt/coverage.py | 379
>> ++
>>  tester/rt/test.py |  36 ++-
>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>>  tester/rtems/testing/qemu.cfg |   4 +-
>>  5 files changed, 446 insertions(+), 12 deletions(-)
>>  create mode 100644 tester/rt/coverage.py
>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
>>
>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>> new file mode 100644
>> index 000..25fbb9d
>> --- /dev/null
>> +++ b/tester/rt/coverage.py
>> @@ -0,0 +1,379 @@
>> +#
>> +# RTEMS Tools Project (http://www.rtems.org/)
>> +# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com)
>> +# All rights reserved.
>> +#
>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
>> +#
>> +# Redistribution and use in source and binary forms, with or without
>> +# modification, are permitted provided that the following conditions are
>> met:
>> +#
>> +# 1. Redistributions of source code must retain the above copyright
>> notice,
>> +# this list of conditions and the following disclaimer.
>> +#
>> +# 2. Redistributions in binary form must reproduce the above copyright
>> notice,
>> +# this list of conditions and the following disclaimer in the
>> documentation
>> +# and/or other materials provided with the distribution.
>> +#
>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>> 'AS IS'
>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
>> THE
>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>> PURPOSE
>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
>> BE
>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>> BUSINESS
>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
>> THE
>> +# POSSIBILITY OF SUCH DAMAGE.
>> +#
>> +
>> +from rtemstoolkit import error
>> +from rtemstoolkit import path
>> +from rtemstoolkit import log
>> +from rtemstoolkit import execute
>> +from rtemstoolkit import macros
>> +
>> +from datetime import datetime
>> +
>> +from . import options
>> +
>> +import shutil
>> +import os
>> +
>> +try:
>> +import configparser
>> +except:
>> +import ConfigParser as configparser
>> +
>> +class summary:
>> +def __init__(self, p_summary_dir):
>> +self.summary_file_path = path.join(p_summary_dir, 'summary.txt')
>> +self.index_file_path = path.join(p_summary_dir, 'index.html')
>> +self.bytes_analyzed = 0
>> +self.bytes_not_executed = 0
>> +self.percentage_executed = 0.0
>> +self.percentage_not_executed = 100.0
>> +self.ranges_uncovered = 0
>> +self.branches_uncovered = 0
>> +self.branches_total = 0
>> +self.branches_always_taken = 0
>> +self.branches_never_taken = 0
>> +self.percentage_branches_covered = 0.0
>> +self.is_failure = False
>> +
>> +def parse(self):
>> +if(not path.exists(self.summary_file_path)):
>> +log.notice('summary file %s does not exist!' %
>> (self.summary_file_path))
>> +self.is_failure = True
>> +return
>> +
>> +with open(self.summary_file_path,'r') as summary_file:
>> +   self.bytes_analyzed = self._get_next_with_colon(summary_file)
>> +   self.bytes_not_executed = self._get_next_with_colon(summ
>> ary_file)
>> +   self.percentage_executed = self._get_next_with_colon(summ
>> ary_file)
>> +   self.percentage_not_executed = self._get_next_with_colon(summ
>> ary_file)
>> +   self.ranges_uncovered = self._get_next_with_colon(summ
>> ary_file)
>> +   self.branches_total = self._get_next_with_colon(summary_file)
>> +   self.branches_uncovered = self._get_next_with_colon(summ
>> ary_file)
>> +   self.branches_always_taken = self._get_next_without_colon(s
>> ummary_file)
>> +   self.branches_never_taken = self._get_next_without_colon(s
>> ummary_file)
>> +if len(self.branches_uncovered) > 0 and len(self.branches_total)
>> > 0:
>> +self.percentage_branches_covered = \
>> +1 - (float(self.branches_uncovered) /
>> float(self.branches_total))
>> +else:
>> + 

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Gedare Bloom
On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
 wrote:
> On 1 June 2018 at 01:07, Cillian O'Donnell  wrote:
>>
>>
>>
>> On 31 May 2018 at 19:07, Vijay Kumar Banerjee 
>> wrote:
>>>
>>> Add support in tester to run covoar and generate an html report to
>>> display
>>> the summary of the coverage reports generated from covoar.
>>>
>>> Co-authored-by : Cillian O'Donnell 
>>> ---
>>>  tester/rt/coverage.py | 379
>>> ++
>>>  tester/rt/test.py |  36 ++-
>>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>>>  tester/rtems/testing/qemu.cfg |   4 +-
>>>  5 files changed, 446 insertions(+), 12 deletions(-)
>>>  create mode 100644 tester/rt/coverage.py
>>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
>>>
>>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>>> new file mode 100644
>>> index 000..25fbb9d
>>> --- /dev/null
>>> +++ b/tester/rt/coverage.py
>>> @@ -0,0 +1,379 @@
>>> +#
>>> +# RTEMS Tools Project (http://www.rtems.org/)
>>> +# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com)
>>> +# All rights reserved.
>>> +#
>>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
>>> +#
>>> +# Redistribution and use in source and binary forms, with or without
>>> +# modification, are permitted provided that the following conditions are
>>> met:
>>> +#
>>> +# 1. Redistributions of source code must retain the above copyright
>>> notice,
>>> +# this list of conditions and the following disclaimer.
>>> +#
>>> +# 2. Redistributions in binary form must reproduce the above copyright
>>> notice,
>>> +# this list of conditions and the following disclaimer in the
>>> documentation
>>> +# and/or other materials provided with the distribution.
>>> +#
>>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>>> 'AS IS'
>>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
>>> THE
>>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>>> PURPOSE
>>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
>>> BE
>>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
>>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>>> BUSINESS
>>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
>>> IN
>>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
>>> OTHERWISE)
>>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
>>> THE
>>> +# POSSIBILITY OF SUCH DAMAGE.
>>> +#
>>> +
>>> +from rtemstoolkit import error
>>> +from rtemstoolkit import path
>>> +from rtemstoolkit import log
>>> +from rtemstoolkit import execute
>>> +from rtemstoolkit import macros
>>> +
>>> +from datetime import datetime
>>> +
>>> +from . import options
>>> +
>>> +import shutil
>>> +import os
>>> +
>>> +try:
>>> +import configparser
>>> +except:
>>> +import ConfigParser as configparser
>>> +
>>> +class summary:
>>> +def __init__(self, p_summary_dir):
>>> +self.summary_file_path = path.join(p_summary_dir, 'summary.txt')
>>> +self.index_file_path = path.join(p_summary_dir, 'index.html')
>>> +self.bytes_analyzed = 0
>>> +self.bytes_not_executed = 0
>>> +self.percentage_executed = 0.0
>>> +self.percentage_not_executed = 100.0
>>> +self.ranges_uncovered = 0
>>> +self.branches_uncovered = 0
>>> +self.branches_total = 0
>>> +self.branches_always_taken = 0
>>> +self.branches_never_taken = 0
>>> +self.percentage_branches_covered = 0.0
>>> +self.is_failure = False
>>> +
>>> +def parse(self):
>>> +if(not path.exists(self.summary_file_path)):
>>> +log.notice('summary file %s does not exist!' %
>>> (self.summary_file_path))
>>> +self.is_failure = True
>>> +return
>>> +
>>> +with open(self.summary_file_path,'r') as summary_file:
>>> +   self.bytes_analyzed = self._get_next_with_colon(summary_file)
>>> +   self.bytes_not_executed =
>>> self._get_next_with_colon(summary_file)
>>> +   self.percentage_executed =
>>> self._get_next_with_colon(summary_file)
>>> +   self.percentage_not_executed =
>>> self._get_next_with_colon(summary_file)
>>> +   self.ranges_uncovered =
>>> self._get_next_with_colon(summary_file)
>>> +   self.branches_total = self._get_next_with_colon(summary_file)
>>> +   self.branches_uncovered =
>>> self._get_next_with_colon(summary_file)
>>> +   self.branches_always_taken =
>>> self._get_next_without_colon(summary_file)
>>> +   self.branches_never_taken =
>>> self._get_next_without_colon(summary_file)
>>> +if len(self.branches_uncovered) > 0 and l

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On 1 June 2018 at 01:19, Gedare Bloom  wrote:

> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>  wrote:
> > On 1 June 2018 at 01:07, Cillian O'Donnell 
> wrote:
> >>
> >>
> >>
> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee  >
> >> wrote:
> >>>
> >>> Add support in tester to run covoar and generate an html report to
> >>> display
> >>> the summary of the coverage reports generated from covoar.
> >>>
> >>> Co-authored-by : Cillian O'Donnell 
> >>> ---
> >>>  tester/rt/coverage.py | 379
> >>> ++
> >>>  tester/rt/test.py |  36 ++-
> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
> >>>  tester/rtems/testing/qemu.cfg |   4 +-
> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
> >>>  create mode 100644 tester/rt/coverage.py
> >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
> >>>
> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> >>> new file mode 100644
> >>> index 000..25fbb9d
> >>> --- /dev/null
> >>> +++ b/tester/rt/coverage.py
> >>> @@ -0,0 +1,379 @@
> >>> +#
> >>> +# RTEMS Tools Project (http://www.rtems.org/)
> >>> +# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com)
> >>> +# All rights reserved.
> >>> +#
> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
> >>> +#
> >>> +# Redistribution and use in source and binary forms, with or without
> >>> +# modification, are permitted provided that the following conditions
> are
> >>> met:
> >>> +#
> >>> +# 1. Redistributions of source code must retain the above copyright
> >>> notice,
> >>> +# this list of conditions and the following disclaimer.
> >>> +#
> >>> +# 2. Redistributions in binary form must reproduce the above copyright
> >>> notice,
> >>> +# this list of conditions and the following disclaimer in the
> >>> documentation
> >>> +# and/or other materials provided with the distribution.
> >>> +#
> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> >>> 'AS IS'
> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
> TO,
> >>> THE
> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> >>> PURPOSE
> >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> CONTRIBUTORS
> >>> BE
> >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> >>> BUSINESS
> >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
> >>> IN
> >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> >>> OTHERWISE)
> >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> OF
> >>> THE
> >>> +# POSSIBILITY OF SUCH DAMAGE.
> >>> +#
> >>> +
> >>> +from rtemstoolkit import error
> >>> +from rtemstoolkit import path
> >>> +from rtemstoolkit import log
> >>> +from rtemstoolkit import execute
> >>> +from rtemstoolkit import macros
> >>> +
> >>> +from datetime import datetime
> >>> +
> >>> +from . import options
> >>> +
> >>> +import shutil
> >>> +import os
> >>> +
> >>> +try:
> >>> +import configparser
> >>> +except:
> >>> +import ConfigParser as configparser
> >>> +
> >>> +class summary:
> >>> +def __init__(self, p_summary_dir):
> >>> +self.summary_file_path = path.join(p_summary_dir,
> 'summary.txt')
> >>> +self.index_file_path = path.join(p_summary_dir, 'index.html')
> >>> +self.bytes_analyzed = 0
> >>> +self.bytes_not_executed = 0
> >>> +self.percentage_executed = 0.0
> >>> +self.percentage_not_executed = 100.0
> >>> +self.ranges_uncovered = 0
> >>> +self.branches_uncovered = 0
> >>> +self.branches_total = 0
> >>> +self.branches_always_taken = 0
> >>> +self.branches_never_taken = 0
> >>> +self.percentage_branches_covered = 0.0
> >>> +self.is_failure = False
> >>> +
> >>> +def parse(self):
> >>> +if(not path.exists(self.summary_file_path)):
> >>> +log.notice('summary file %s does not exist!' %
> >>> (self.summary_file_path))
> >>> +self.is_failure = True
> >>> +return
> >>> +
> >>> +with open(self.summary_file_path,'r') as summary_file:
> >>> +   self.bytes_analyzed = self._get_next_with_colon(
> summary_file)
> >>> +   self.bytes_not_executed =
> >>> self._get_next_with_colon(summary_file)
> >>> +   self.percentage_executed =
> >>> self._get_next_with_colon(summary_file)
> >>> +   self.percentage_not_executed =
> >>> self._get_next_with_colon(summary_file)
> >>> +   self.ranges_uncovered =
> >>> self._get_next_with_colon(summary_file)
> >>> +   self.branches_total = self._get_next_with_colon(
> summary_file)
> >>> 

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Cillian O'Donnell
So is it checking whether it's --coverage or --coverage=set1,set2? Are
those the 2 possibilities your checking?

On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, 
wrote:

> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>
>> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>>  wrote:
>> > On 1 June 2018 at 01:07, Cillian O'Donnell 
>> wrote:
>> >>
>> >>
>> >>
>> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
>> vijaykumar9...@gmail.com>
>> >> wrote:
>> >>>
>> >>> Add support in tester to run covoar and generate an html report to
>> >>> display
>> >>> the summary of the coverage reports generated from covoar.
>> >>>
>> >>> Co-authored-by : Cillian O'Donnell 
>> >>> ---
>> >>>  tester/rt/coverage.py | 379
>> >>> ++
>> >>>  tester/rt/test.py |  36 ++-
>> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>> >>>  tester/rtems/testing/qemu.cfg |   4 +-
>> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
>> >>>  create mode 100644 tester/rt/coverage.py
>> >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
>> >>>
>> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>> >>> new file mode 100644
>> >>> index 000..25fbb9d
>> >>> --- /dev/null
>> >>> +++ b/tester/rt/coverage.py
>> >>> @@ -0,0 +1,379 @@
>> >>> +#
>> >>> +# RTEMS Tools Project (http://www.rtems.org/)
>> >>> +# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com)
>> >>> +# All rights reserved.
>> >>> +#
>> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
>> >>> +#
>> >>> +# Redistribution and use in source and binary forms, with or without
>> >>> +# modification, are permitted provided that the following conditions
>> are
>> >>> met:
>> >>> +#
>> >>> +# 1. Redistributions of source code must retain the above copyright
>> >>> notice,
>> >>> +# this list of conditions and the following disclaimer.
>> >>> +#
>> >>> +# 2. Redistributions in binary form must reproduce the above
>> copyright
>> >>> notice,
>> >>> +# this list of conditions and the following disclaimer in the
>> >>> documentation
>> >>> +# and/or other materials provided with the distribution.
>> >>> +#
>> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>> >>> 'AS IS'
>> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
>> TO,
>> >>> THE
>> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>> >>> PURPOSE
>> >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
>> CONTRIBUTORS
>> >>> BE
>> >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
>> >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
>> OF
>> >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>> >>> BUSINESS
>> >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
>> WHETHER
>> >>> IN
>> >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
>> >>> OTHERWISE)
>> >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
>> ADVISED OF
>> >>> THE
>> >>> +# POSSIBILITY OF SUCH DAMAGE.
>> >>> +#
>> >>> +
>> >>> +from rtemstoolkit import error
>> >>> +from rtemstoolkit import path
>> >>> +from rtemstoolkit import log
>> >>> +from rtemstoolkit import execute
>> >>> +from rtemstoolkit import macros
>> >>> +
>> >>> +from datetime import datetime
>> >>> +
>> >>> +from . import options
>> >>> +
>> >>> +import shutil
>> >>> +import os
>> >>> +
>> >>> +try:
>> >>> +import configparser
>> >>> +except:
>> >>> +import ConfigParser as configparser
>> >>> +
>> >>> +class summary:
>> >>> +def __init__(self, p_summary_dir):
>> >>> +self.summary_file_path = path.join(p_summary_dir,
>> 'summary.txt')
>> >>> +self.index_file_path = path.join(p_summary_dir, 'index.html')
>> >>> +self.bytes_analyzed = 0
>> >>> +self.bytes_not_executed = 0
>> >>> +self.percentage_executed = 0.0
>> >>> +self.percentage_not_executed = 100.0
>> >>> +self.ranges_uncovered = 0
>> >>> +self.branches_uncovered = 0
>> >>> +self.branches_total = 0
>> >>> +self.branches_always_taken = 0
>> >>> +self.branches_never_taken = 0
>> >>> +self.percentage_branches_covered = 0.0
>> >>> +self.is_failure = False
>> >>> +
>> >>> +def parse(self):
>> >>> +if(not path.exists(self.summary_file_path)):
>> >>> +log.notice('summary file %s does not exist!' %
>> >>> (self.summary_file_path))
>> >>> +self.is_failure = True
>> >>> +return
>> >>> +
>> >>> +with open(self.summary_file_path,'r') as summary_file:
>> >>> +   self.bytes_analyzed =
>> self._get_next_with_colon(summary_file)
>> >>> +   self.bytes_not_executed =
>> >>> self._get_next_with_colon(summary_file)
>> >>> +   self.perc

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On 1 June 2018 at 01:57, Cillian O'Donnell  wrote:

> So is it checking whether it's --coverage or --coverage=set1,set2? Are
> those the 2 possibilities your checking?
>
> Yes, right. :)

> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, 
> wrote:
>
>> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>>
>>> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>>>  wrote:
>>> > On 1 June 2018 at 01:07, Cillian O'Donnell 
>>> wrote:
>>> >>
>>> >>
>>> >>
>>> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
>>> vijaykumar9...@gmail.com>
>>> >> wrote:
>>> >>>
>>> >>> Add support in tester to run covoar and generate an html report to
>>> >>> display
>>> >>> the summary of the coverage reports generated from covoar.
>>> >>>
>>> >>> Co-authored-by : Cillian O'Donnell 
>>> >>> ---
>>> >>>  tester/rt/coverage.py | 379
>>> >>> ++
>>> >>>  tester/rt/test.py |  36 ++-
>>> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>>> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>>> >>>  tester/rtems/testing/qemu.cfg |   4 +-
>>> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
>>> >>>  create mode 100644 tester/rt/coverage.py
>>> >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
>>> >>>
>>> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>>> >>> new file mode 100644
>>> >>> index 000..25fbb9d
>>> >>> --- /dev/null
>>> >>> +++ b/tester/rt/coverage.py
>>> >>> @@ -0,0 +1,379 @@
>>> >>> +#
>>> >>> +# RTEMS Tools Project (http://www.rtems.org/)
>>> >>> +# Copyright 2014 Krzysztof Miesowicz (krzysztof.miesow...@gmail.com
>>> )
>>> >>> +# All rights reserved.
>>> >>> +#
>>> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
>>> >>> +#
>>> >>> +# Redistribution and use in source and binary forms, with or without
>>> >>> +# modification, are permitted provided that the following
>>> conditions are
>>> >>> met:
>>> >>> +#
>>> >>> +# 1. Redistributions of source code must retain the above copyright
>>> >>> notice,
>>> >>> +# this list of conditions and the following disclaimer.
>>> >>> +#
>>> >>> +# 2. Redistributions in binary form must reproduce the above
>>> copyright
>>> >>> notice,
>>> >>> +# this list of conditions and the following disclaimer in the
>>> >>> documentation
>>> >>> +# and/or other materials provided with the distribution.
>>> >>> +#
>>> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
>>> CONTRIBUTORS
>>> >>> 'AS IS'
>>> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
>>> TO,
>>> >>> THE
>>> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
>>> >>> PURPOSE
>>> >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
>>> CONTRIBUTORS
>>> >>> BE
>>> >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
>>> OR
>>> >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
>>> OF
>>> >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>>> >>> BUSINESS
>>> >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
>>> WHETHER
>>> >>> IN
>>> >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
>>> >>> OTHERWISE)
>>> >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
>>> ADVISED OF
>>> >>> THE
>>> >>> +# POSSIBILITY OF SUCH DAMAGE.
>>> >>> +#
>>> >>> +
>>> >>> +from rtemstoolkit import error
>>> >>> +from rtemstoolkit import path
>>> >>> +from rtemstoolkit import log
>>> >>> +from rtemstoolkit import execute
>>> >>> +from rtemstoolkit import macros
>>> >>> +
>>> >>> +from datetime import datetime
>>> >>> +
>>> >>> +from . import options
>>> >>> +
>>> >>> +import shutil
>>> >>> +import os
>>> >>> +
>>> >>> +try:
>>> >>> +import configparser
>>> >>> +except:
>>> >>> +import ConfigParser as configparser
>>> >>> +
>>> >>> +class summary:
>>> >>> +def __init__(self, p_summary_dir):
>>> >>> +self.summary_file_path = path.join(p_summary_dir,
>>> 'summary.txt')
>>> >>> +self.index_file_path = path.join(p_summary_dir,
>>> 'index.html')
>>> >>> +self.bytes_analyzed = 0
>>> >>> +self.bytes_not_executed = 0
>>> >>> +self.percentage_executed = 0.0
>>> >>> +self.percentage_not_executed = 100.0
>>> >>> +self.ranges_uncovered = 0
>>> >>> +self.branches_uncovered = 0
>>> >>> +self.branches_total = 0
>>> >>> +self.branches_always_taken = 0
>>> >>> +self.branches_never_taken = 0
>>> >>> +self.percentage_branches_covered = 0.0
>>> >>> +self.is_failure = False
>>> >>> +
>>> >>> +def parse(self):
>>> >>> +if(not path.exists(self.summary_file_path)):
>>> >>> +log.notice('summary file %s does not exist!' %
>>> >>> (self.summary_file_path))
>>> >>> +self.is_failure = True
>>> >>> +return
>>> >>> +
>>> >>> +with open(self.summary_file_path,'r

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Cillian O'Donnell
There is now a seperate bsp config for coverage, leon3-qemu-cov. That is
enough to trigger coverage now and --coverage could be reserved for picking
sets, probably renamed to --coverage-sets=... Or require sets to be chosen
--coverage-sets=all or specific sets --coverage-sets=score,sapi,core

On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, 
wrote:

> On 1 June 2018 at 01:57, Cillian O'Donnell  wrote:
>
>> So is it checking whether it's --coverage or --coverage=set1,set2? Are
>> those the 2 possibilities your checking?
>>
>> Yes, right. :)
>
>> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
>> vijaykumar9...@gmail.com> wrote:
>>
>>> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>>>
 On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
  wrote:
 > On 1 June 2018 at 01:07, Cillian O'Donnell 
 wrote:
 >>
 >>
 >>
 >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
 vijaykumar9...@gmail.com>
 >> wrote:
 >>>
 >>> Add support in tester to run covoar and generate an html report to
 >>> display
 >>> the summary of the coverage reports generated from covoar.
 >>>
 >>> Co-authored-by : Cillian O'Donnell 
 >>> ---
 >>>  tester/rt/coverage.py | 379
 >>> ++
 >>>  tester/rt/test.py |  36 ++-
 >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
 >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
 >>>  tester/rtems/testing/qemu.cfg |   4 +-
 >>>  5 files changed, 446 insertions(+), 12 deletions(-)
 >>>  create mode 100644 tester/rt/coverage.py
 >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
 >>>
 >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
 >>> new file mode 100644
 >>> index 000..25fbb9d
 >>> --- /dev/null
 >>> +++ b/tester/rt/coverage.py
 >>> @@ -0,0 +1,379 @@
 >>> +#
 >>> +# RTEMS Tools Project (http://www.rtems.org/)
 >>> +# Copyright 2014 Krzysztof Miesowicz (
 krzysztof.miesow...@gmail.com)
 >>> +# All rights reserved.
 >>> +#
 >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
 >>> +#
 >>> +# Redistribution and use in source and binary forms, with or
 without
 >>> +# modification, are permitted provided that the following
 conditions are
 >>> met:
 >>> +#
 >>> +# 1. Redistributions of source code must retain the above copyright
 >>> notice,
 >>> +# this list of conditions and the following disclaimer.
 >>> +#
 >>> +# 2. Redistributions in binary form must reproduce the above
 copyright
 >>> notice,
 >>> +# this list of conditions and the following disclaimer in the
 >>> documentation
 >>> +# and/or other materials provided with the distribution.
 >>> +#
 >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 CONTRIBUTORS
 >>> 'AS IS'
 >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 LIMITED TO,
 >>> THE
 >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 PARTICULAR
 >>> PURPOSE
 >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 CONTRIBUTORS
 >>> BE
 >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 OR
 >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF
 >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 >>> BUSINESS
 >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 WHETHER
 >>> IN
 >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 >>> OTHERWISE)
 >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 ADVISED OF
 >>> THE
 >>> +# POSSIBILITY OF SUCH DAMAGE.
 >>> +#
 >>> +
 >>> +from rtemstoolkit import error
 >>> +from rtemstoolkit import path
 >>> +from rtemstoolkit import log
 >>> +from rtemstoolkit import execute
 >>> +from rtemstoolkit import macros
 >>> +
 >>> +from datetime import datetime
 >>> +
 >>> +from . import options
 >>> +
 >>> +import shutil
 >>> +import os
 >>> +
 >>> +try:
 >>> +import configparser
 >>> +except:
 >>> +import ConfigParser as configparser
 >>> +
 >>> +class summary:
 >>> +def __init__(self, p_summary_dir):
 >>> +self.summary_file_path = path.join(p_summary_dir,
 'summary.txt')
 >>> +self.index_file_path = path.join(p_summary_dir,
 'index.html')
 >>> +self.bytes_analyzed = 0
 >>> +self.bytes_not_executed = 0
 >>> +self.percentage_executed = 0.0
 >>> +self.percentage_not_executed = 100.0
 >>> +self.ranges_uncovered = 0
 >>> +self.branches_uncovered = 0
 >>> +self.branches_total = 0
 >>> +  

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Gedare Bloom
On Thu, May 31, 2018 at 4:44 PM, Cillian O'Donnell
 wrote:
> There is now a seperate bsp config for coverage, leon3-qemu-cov. That is
> enough to trigger coverage now and --coverage could be reserved for picking
> sets, probably renamed to --coverage-sets=... Or require sets to be chosen
> --coverage-sets=all or specific sets --coverage-sets=score,sapi,core
>
Yes, and it should work for more than 1 or 2.

> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, 
> wrote:
>>
>> On 1 June 2018 at 01:57, Cillian O'Donnell  wrote:
>>>
>>> So is it checking whether it's --coverage or --coverage=set1,set2? Are
>>> those the 2 possibilities your checking?
>>>
>> Yes, right. :)
>>>
>>> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee,
>>>  wrote:

 On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>
> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>  wrote:
> > On 1 June 2018 at 01:07, Cillian O'Donnell 
> > wrote:
> >>
> >>
> >>
> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee
> >> 
> >> wrote:
> >>>
> >>> Add support in tester to run covoar and generate an html report to
> >>> display
> >>> the summary of the coverage reports generated from covoar.
> >>>
> >>> Co-authored-by : Cillian O'Donnell 
> >>> ---
> >>>  tester/rt/coverage.py | 379
> >>> ++
> >>>  tester/rt/test.py |  36 ++-
> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
> >>>  tester/rtems/testing/qemu.cfg |   4 +-
> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
> >>>  create mode 100644 tester/rt/coverage.py
> >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
> >>>
> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> >>> new file mode 100644
> >>> index 000..25fbb9d
> >>> --- /dev/null
> >>> +++ b/tester/rt/coverage.py
> >>> @@ -0,0 +1,379 @@
> >>> +#
> >>> +# RTEMS Tools Project (http://www.rtems.org/)
> >>> +# Copyright 2014 Krzysztof Miesowicz
> >>> (krzysztof.miesow...@gmail.com)
> >>> +# All rights reserved.
> >>> +#
> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
> >>> +#
> >>> +# Redistribution and use in source and binary forms, with or
> >>> without
> >>> +# modification, are permitted provided that the following
> >>> conditions are
> >>> met:
> >>> +#
> >>> +# 1. Redistributions of source code must retain the above
> >>> copyright
> >>> notice,
> >>> +# this list of conditions and the following disclaimer.
> >>> +#
> >>> +# 2. Redistributions in binary form must reproduce the above
> >>> copyright
> >>> notice,
> >>> +# this list of conditions and the following disclaimer in the
> >>> documentation
> >>> +# and/or other materials provided with the distribution.
> >>> +#
> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> >>> CONTRIBUTORS
> >>> 'AS IS'
> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> >>> LIMITED TO,
> >>> THE
> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
> >>> PARTICULAR
> >>> PURPOSE
> >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> >>> CONTRIBUTORS
> >>> BE
> >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
> >>> OR
> >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> >>> PROCUREMENT OF
> >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> >>> BUSINESS
> >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> >>> WHETHER
> >>> IN
> >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> >>> OTHERWISE)
> >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> >>> ADVISED OF
> >>> THE
> >>> +# POSSIBILITY OF SUCH DAMAGE.
> >>> +#
> >>> +
> >>> +from rtemstoolkit import error
> >>> +from rtemstoolkit import path
> >>> +from rtemstoolkit import log
> >>> +from rtemstoolkit import execute
> >>> +from rtemstoolkit import macros
> >>> +
> >>> +from datetime import datetime
> >>> +
> >>> +from . import options
> >>> +
> >>> +import shutil
> >>> +import os
> >>> +
> >>> +try:
> >>> +import configparser
> >>> +except:
> >>> +import ConfigParser as configparser
> >>> +
> >>> +class summary:
> >>> +def __init__(self, p_summary_dir):
> >>> +self.summary_file_path = path.join(p_summary_dir,
> >>> 'summary.txt')
> >>> +self.index_file_path = path.join(p_summary_dir,
> >>> 'index.html')
> >>> +self.bytes_analyzed = 0
> >>> +self.bytes_

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On 1 June 2018 at 02:14, Cillian O'Donnell  wrote:

> There is now a seperate bsp config for coverage, leon3-qemu-cov. That is
> enough to trigger coverage now and --coverage could be reserved for picking
> sets, probably renamed to --coverage-sets=... Or require sets to be chosen
> --coverage-sets=all or specific sets --coverage-sets=score,sapi,core
>
> Actually the idea of having separate bsp configs for cov
in each of the bsps will create a lot of files. The intention is
to make it simple for the user. just adding --coverage
should run coverage analysis. There's a plan to include
the 'coverage' section into the bsp ini file, and hence the user wouldn't
have to keep switching the bsp config files.

The idea of modifying it to --coverage-sets=all ;
--coverage-sets=set1,set2,set3. can surely be implemented
in place of --coverage ; --coverage=set1,set2

> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, 
> wrote:
>
>> On 1 June 2018 at 01:57, Cillian O'Donnell  wrote:
>>
>>> So is it checking whether it's --coverage or --coverage=set1,set2? Are
>>> those the 2 possibilities your checking?
>>>
>>> Yes, right. :)
>>
>>> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
>>> vijaykumar9...@gmail.com> wrote:
>>>
 On 1 June 2018 at 01:19, Gedare Bloom  wrote:

> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>  wrote:
> > On 1 June 2018 at 01:07, Cillian O'Donnell 
> wrote:
> >>
> >>
> >>
> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com>
> >> wrote:
> >>>
> >>> Add support in tester to run covoar and generate an html report to
> >>> display
> >>> the summary of the coverage reports generated from covoar.
> >>>
> >>> Co-authored-by : Cillian O'Donnell 
> >>> ---
> >>>  tester/rt/coverage.py | 379
> >>> ++
> >>>  tester/rt/test.py |  36 ++-
> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
> >>>  tester/rtems/testing/qemu.cfg |   4 +-
> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
> >>>  create mode 100644 tester/rt/coverage.py
> >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
> >>>
> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> >>> new file mode 100644
> >>> index 000..25fbb9d
> >>> --- /dev/null
> >>> +++ b/tester/rt/coverage.py
> >>> @@ -0,0 +1,379 @@
> >>> +#
> >>> +# RTEMS Tools Project (http://www.rtems.org/)
> >>> +# Copyright 2014 Krzysztof Miesowicz (
> krzysztof.miesow...@gmail.com)
> >>> +# All rights reserved.
> >>> +#
> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
> >>> +#
> >>> +# Redistribution and use in source and binary forms, with or
> without
> >>> +# modification, are permitted provided that the following
> conditions are
> >>> met:
> >>> +#
> >>> +# 1. Redistributions of source code must retain the above
> copyright
> >>> notice,
> >>> +# this list of conditions and the following disclaimer.
> >>> +#
> >>> +# 2. Redistributions in binary form must reproduce the above
> copyright
> >>> notice,
> >>> +# this list of conditions and the following disclaimer in the
> >>> documentation
> >>> +# and/or other materials provided with the distribution.
> >>> +#
> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> CONTRIBUTORS
> >>> 'AS IS'
> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> LIMITED TO,
> >>> THE
> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
> PARTICULAR
> >>> PURPOSE
> >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> CONTRIBUTORS
> >>> BE
> >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> EXEMPLARY, OR
> >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> PROCUREMENT OF
> >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> >>> BUSINESS
> >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> WHETHER
> >>> IN
> >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> >>> OTHERWISE)
> >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> ADVISED OF
> >>> THE
> >>> +# POSSIBILITY OF SUCH DAMAGE.
> >>> +#
> >>> +
> >>> +from rtemstoolkit import error
> >>> +from rtemstoolkit import path
> >>> +from rtemstoolkit import log
> >>> +from rtemstoolkit import execute
> >>> +from rtemstoolkit import macros
> >>> +
> >>> +from datetime import datetime
> >>> +
> >>> +from . import options
> >>> +
> >>> +import shutil
> >>> +import os
> >>> +
> >>>

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On 1 June 2018 at 02:15, Gedare Bloom  wrote:

> On Thu, May 31, 2018 at 4:44 PM, Cillian O'Donnell
>  wrote:
> > There is now a seperate bsp config for coverage, leon3-qemu-cov. That is
> > enough to trigger coverage now and --coverage could be reserved for
> picking
> > sets, probably renamed to --coverage-sets=... Or require sets to be
> chosen
> > --coverage-sets=all or specific sets --coverage-sets=score,sapi,core
> >
> Yes, and it should work for more than 1 or 2.
>
> It can work for any number of sets.

> > On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
> vijaykumar9...@gmail.com>
> > wrote:
> >>
> >> On 1 June 2018 at 01:57, Cillian O'Donnell 
> wrote:
> >>>
> >>> So is it checking whether it's --coverage or --coverage=set1,set2? Are
> >>> those the 2 possibilities your checking?
> >>>
> >> Yes, right. :)
> >>>
> >>> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee,
> >>>  wrote:
> 
>  On 1 June 2018 at 01:19, Gedare Bloom  wrote:
> >
> > On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
> >  wrote:
> > > On 1 June 2018 at 01:07, Cillian O'Donnell 
> > > wrote:
> > >>
> > >>
> > >>
> > >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee
> > >> 
> > >> wrote:
> > >>>
> > >>> Add support in tester to run covoar and generate an html report
> to
> > >>> display
> > >>> the summary of the coverage reports generated from covoar.
> > >>>
> > >>> Co-authored-by : Cillian O'Donnell 
> > >>> ---
> > >>>  tester/rt/coverage.py | 379
> > >>> ++
> > >>>  tester/rt/test.py |  36 ++-
> > >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
> > >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
> > >>>  tester/rtems/testing/qemu.cfg |   4 +-
> > >>>  5 files changed, 446 insertions(+), 12 deletions(-)
> > >>>  create mode 100644 tester/rt/coverage.py
> > >>>  create mode 100644 tester/rtems/testing/coverage/
> symbol-sets.ini
> > >>>
> > >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> > >>> new file mode 100644
> > >>> index 000..25fbb9d
> > >>> --- /dev/null
> > >>> +++ b/tester/rt/coverage.py
> > >>> @@ -0,0 +1,379 @@
> > >>> +#
> > >>> +# RTEMS Tools Project (http://www.rtems.org/)
> > >>> +# Copyright 2014 Krzysztof Miesowicz
> > >>> (krzysztof.miesow...@gmail.com)
> > >>> +# All rights reserved.
> > >>> +#
> > >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
> > >>> +#
> > >>> +# Redistribution and use in source and binary forms, with or
> > >>> without
> > >>> +# modification, are permitted provided that the following
> > >>> conditions are
> > >>> met:
> > >>> +#
> > >>> +# 1. Redistributions of source code must retain the above
> > >>> copyright
> > >>> notice,
> > >>> +# this list of conditions and the following disclaimer.
> > >>> +#
> > >>> +# 2. Redistributions in binary form must reproduce the above
> > >>> copyright
> > >>> notice,
> > >>> +# this list of conditions and the following disclaimer in the
> > >>> documentation
> > >>> +# and/or other materials provided with the distribution.
> > >>> +#
> > >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> > >>> CONTRIBUTORS
> > >>> 'AS IS'
> > >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > >>> LIMITED TO,
> > >>> THE
> > >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
> > >>> PARTICULAR
> > >>> PURPOSE
> > >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> > >>> CONTRIBUTORS
> > >>> BE
> > >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> EXEMPLARY,
> > >>> OR
> > >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> > >>> PROCUREMENT OF
> > >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
> OR
> > >>> BUSINESS
> > >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> > >>> WHETHER
> > >>> IN
> > >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> > >>> OTHERWISE)
> > >>> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> > >>> ADVISED OF
> > >>> THE
> > >>> +# POSSIBILITY OF SUCH DAMAGE.
> > >>> +#
> > >>> +
> > >>> +from rtemstoolkit import error
> > >>> +from rtemstoolkit import path
> > >>> +from rtemstoolkit import log
> > >>> +from rtemstoolkit import execute
> > >>> +from rtemstoolkit import macros
> > >>> +
> > >>> +from datetime import datetime
> > >>> +
> > >>> +from . import options
> > >>> +
> > >>> +import shutil
> > >>> +import os
> > >>> +
> > >>> +try:
> > >>> +import configparser
> > >>> +except:
> > >>> 

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Cillian O'Donnell
On Thu, 31 May 2018, 22:03 Vijay Kumar Banerjee, 
wrote:

> On 1 June 2018 at 02:14, Cillian O'Donnell  wrote:
>
>> There is now a seperate bsp config for coverage, leon3-qemu-cov. That is
>> enough to trigger coverage now and --coverage could be reserved for picking
>> sets, probably renamed to --coverage-sets=... Or require sets to be chosen
>> --coverage-sets=all or specific sets --coverage-sets=score,sapi,core
>>
>> Actually the idea of having separate bsp configs for cov
> in each of the bsps will create a lot of files. The intention is
> to make it simple for the user. just adding --coverage
> should run coverage analysis. There's a plan to include
> the 'coverage' section into the bsp ini file, and hence the user wouldn't
> have to keep switching the bsp config files.
>

Actually that's exactly the way I had it working before Chris' recent
changes, he had a look at the way it's working and chose to create seperate
bsp config files. That may be the way he'd prefer. This was before the
--coverage option had another use other than triggering coverage, so his
thoughts may have changed on it.

>
> The idea of modifying it to --coverage-sets=all ;
> --coverage-sets=set1,set2,set3. can surely be implemented
> in place of --coverage ; --coverage=set1,set2
>
>> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
>> vijaykumar9...@gmail.com> wrote:
>>
>>> On 1 June 2018 at 01:57, Cillian O'Donnell 
>>> wrote:
>>>
 So is it checking whether it's --coverage or --coverage=set1,set2? Are
 those the 2 possibilities your checking?

 Yes, right. :)
>>>
 On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
 vijaykumar9...@gmail.com> wrote:

> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>
>> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>>  wrote:
>> > On 1 June 2018 at 01:07, Cillian O'Donnell 
>> wrote:
>> >>
>> >>
>> >>
>> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
>> vijaykumar9...@gmail.com>
>> >> wrote:
>> >>>
>> >>> Add support in tester to run covoar and generate an html report to
>> >>> display
>> >>> the summary of the coverage reports generated from covoar.
>> >>>
>> >>> Co-authored-by : Cillian O'Donnell 
>> >>> ---
>> >>>  tester/rt/coverage.py | 379
>> >>> ++
>> >>>  tester/rt/test.py |  36 ++-
>> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>> >>>  tester/rtems/testing/qemu.cfg |   4 +-
>> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
>> >>>  create mode 100644 tester/rt/coverage.py
>> >>>  create mode 100644 tester/rtems/testing/coverage/symbol-sets.ini
>> >>>
>> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>> >>> new file mode 100644
>> >>> index 000..25fbb9d
>> >>> --- /dev/null
>> >>> +++ b/tester/rt/coverage.py
>> >>> @@ -0,0 +1,379 @@
>> >>> +#
>> >>> +# RTEMS Tools Project (http://www.rtems.org/)
>> >>> +# Copyright 2014 Krzysztof Miesowicz (
>> krzysztof.miesow...@gmail.com)
>> >>> +# All rights reserved.
>> >>> +#
>> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
>> >>> +#
>> >>> +# Redistribution and use in source and binary forms, with or
>> without
>> >>> +# modification, are permitted provided that the following
>> conditions are
>> >>> met:
>> >>> +#
>> >>> +# 1. Redistributions of source code must retain the above
>> copyright
>> >>> notice,
>> >>> +# this list of conditions and the following disclaimer.
>> >>> +#
>> >>> +# 2. Redistributions in binary form must reproduce the above
>> copyright
>> >>> notice,
>> >>> +# this list of conditions and the following disclaimer in the
>> >>> documentation
>> >>> +# and/or other materials provided with the distribution.
>> >>> +#
>> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
>> CONTRIBUTORS
>> >>> 'AS IS'
>> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>> LIMITED TO,
>> >>> THE
>> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
>> PARTICULAR
>> >>> PURPOSE
>> >>> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
>> CONTRIBUTORS
>> >>> BE
>> >>> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
>> EXEMPLARY, OR
>> >>> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
>> PROCUREMENT OF
>> >>> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
>> >>> BUSINESS
>> >>> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
>> WHETHER
>> >>> IN
>> >>> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
>> >>> OTHERWISE)
>> >>> +# ARI

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Joel Sherrill
On Thu, May 31, 2018 at 4:15 PM, Cillian O'Donnell 
wrote:

>
>
> On Thu, 31 May 2018, 22:03 Vijay Kumar Banerjee, 
> wrote:
>
>> On 1 June 2018 at 02:14, Cillian O'Donnell  wrote:
>>
>>> There is now a seperate bsp config for coverage, leon3-qemu-cov. That is
>>> enough to trigger coverage now and --coverage could be reserved for picking
>>> sets, probably renamed to --coverage-sets=... Or require sets to be chosen
>>> --coverage-sets=all or specific sets --coverage-sets=score,sapi,core
>>>
>>> Actually the idea of having separate bsp configs for cov
>> in each of the bsps will create a lot of files. The intention is
>> to make it simple for the user. just adding --coverage
>> should run coverage analysis. There's a plan to include
>> the 'coverage' section into the bsp ini file, and hence the user wouldn't
>> have to keep switching the bsp config files.
>>
>
> Actually that's exactly the way I had it working before Chris' recent
> changes, he had a look at the way it's working and chose to create seperate
> bsp config files. That may be the way he'd prefer. This was before the
> --coverage option had another use other than triggering coverage, so his
> thoughts may have changed on it.
>

Chris should comment on the separate ini files. I think that might have been
driven by couverture vs regular qemu before couverture was available from
the RSB.

I think it would be nice to have --coverage and if the BSP ini file doesn't
support
coverage, give an error.

Is the set option in the Python and processed by covoar in a way that still
lets covoar be used on something besides RTEMS?


>
>> The idea of modifying it to --coverage-sets=all ;
>> --coverage-sets=set1,set2,set3. can surely be implemented
>> in place of --coverage ; --coverage=set1,set2
>>
>>> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
>>> vijaykumar9...@gmail.com> wrote:
>>>
 On 1 June 2018 at 01:57, Cillian O'Donnell 
 wrote:

> So is it checking whether it's --coverage or --coverage=set1,set2? Are
> those the 2 possibilities your checking?
>
> Yes, right. :)

> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
> vijaykumar9...@gmail.com> wrote:
>
>> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>>
>>> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>>>  wrote:
>>> > On 1 June 2018 at 01:07, Cillian O'Donnell 
>>> wrote:
>>> >>
>>> >>
>>> >>
>>> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
>>> vijaykumar9...@gmail.com>
>>> >> wrote:
>>> >>>
>>> >>> Add support in tester to run covoar and generate an html report
>>> to
>>> >>> display
>>> >>> the summary of the coverage reports generated from covoar.
>>> >>>
>>> >>> Co-authored-by : Cillian O'Donnell 
>>> >>> ---
>>> >>>  tester/rt/coverage.py | 379
>>> >>> ++
>>> >>>  tester/rt/test.py |  36 ++-
>>> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>>> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>>> >>>  tester/rtems/testing/qemu.cfg |   4 +-
>>> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
>>> >>>  create mode 100644 tester/rt/coverage.py
>>> >>>  create mode 100644 tester/rtems/testing/coverage/
>>> symbol-sets.ini
>>> >>>
>>> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>>> >>> new file mode 100644
>>> >>> index 000..25fbb9d
>>> >>> --- /dev/null
>>> >>> +++ b/tester/rt/coverage.py
>>> >>> @@ -0,0 +1,379 @@
>>> >>> +#
>>> >>> +# RTEMS Tools Project (http://www.rtems.org/)
>>> >>> +# Copyright 2014 Krzysztof Miesowicz (
>>> krzysztof.miesow...@gmail.com)
>>> >>> +# All rights reserved.
>>> >>> +#
>>> >>> +# This file is part of the RTEMS Tools package in 'rtems-tools'.
>>> >>> +#
>>> >>> +# Redistribution and use in source and binary forms, with or
>>> without
>>> >>> +# modification, are permitted provided that the following
>>> conditions are
>>> >>> met:
>>> >>> +#
>>> >>> +# 1. Redistributions of source code must retain the above
>>> copyright
>>> >>> notice,
>>> >>> +# this list of conditions and the following disclaimer.
>>> >>> +#
>>> >>> +# 2. Redistributions in binary form must reproduce the above
>>> copyright
>>> >>> notice,
>>> >>> +# this list of conditions and the following disclaimer in the
>>> >>> documentation
>>> >>> +# and/or other materials provided with the distribution.
>>> >>> +#
>>> >>> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
>>> CONTRIBUTORS
>>> >>> 'AS IS'
>>> >>> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>>> LIMITED TO,
>>> >>> THE
>>> >>> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
>>> PARTICULAR
>>> >>> PURPOSE
>>>

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On 1 June 2018 at 02:50, Joel Sherrill  wrote:

>
>
> On Thu, May 31, 2018 at 4:15 PM, Cillian O'Donnell 
> wrote:
>
>>
>>
>> On Thu, 31 May 2018, 22:03 Vijay Kumar Banerjee, <
>> vijaykumar9...@gmail.com> wrote:
>>
>>> On 1 June 2018 at 02:14, Cillian O'Donnell 
>>> wrote:
>>>
 There is now a seperate bsp config for coverage, leon3-qemu-cov. That
 is enough to trigger coverage now and --coverage could be reserved for
 picking sets, probably renamed to --coverage-sets=... Or require sets to be
 chosen --coverage-sets=all or specific sets --coverage-sets=score,sapi,cor
 e

 Actually the idea of having separate bsp configs for cov
>>> in each of the bsps will create a lot of files. The intention is
>>> to make it simple for the user. just adding --coverage
>>> should run coverage analysis. There's a plan to include
>>> the 'coverage' section into the bsp ini file, and hence the user wouldn't
>>> have to keep switching the bsp config files.
>>>
>>
>> Actually that's exactly the way I had it working before Chris' recent
>> changes, he had a look at the way it's working and chose to create seperate
>> bsp config files. That may be the way he'd prefer. This was before the
>> --coverage option had another use other than triggering coverage, so his
>> thoughts may have changed on it.
>>
>
> Chris should comment on the separate ini files. I think that might have
> been
> driven by couverture vs regular qemu before couverture was available from
> the RSB.
>
> Okay, we wait for Chris to comment on it then.

> I think it would be nice to have --coverage and if the BSP ini file
> doesn't support
> coverage, give an error.
>
>
Is the set option in the Python and processed by covoar in a way that still
> lets covoar be used on something besides RTEMS?
>
>
yes, it is totally handled by the script to 'feed' covoar with the options,
without changing the way it works.

I have a question/doubt.
By adding separate bsp config for cov. Are we not assuming that
the provided bsp ini supports coverage ?


>>> The idea of modifying it to --coverage-sets=all ;
>>> --coverage-sets=set1,set2,set3. can surely be implemented
>>> in place of --coverage ; --coverage=set1,set2
>>>
 On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
 vijaykumar9...@gmail.com> wrote:

> On 1 June 2018 at 01:57, Cillian O'Donnell 
> wrote:
>
>> So is it checking whether it's --coverage or --coverage=set1,set2?
>> Are those the 2 possibilities your checking?
>>
>> Yes, right. :)
>
>> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
>> vijaykumar9...@gmail.com> wrote:
>>
>>> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>>>
 On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
  wrote:
 > On 1 June 2018 at 01:07, Cillian O'Donnell 
 wrote:
 >>
 >>
 >>
 >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
 vijaykumar9...@gmail.com>
 >> wrote:
 >>>
 >>> Add support in tester to run covoar and generate an html report
 to
 >>> display
 >>> the summary of the coverage reports generated from covoar.
 >>>
 >>> Co-authored-by : Cillian O'Donnell 
 >>> ---
 >>>  tester/rt/coverage.py | 379
 >>> ++
 >>>  tester/rt/test.py |  36 ++-
 >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
 >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
 >>>  tester/rtems/testing/qemu.cfg |   4 +-
 >>>  5 files changed, 446 insertions(+), 12 deletions(-)
 >>>  create mode 100644 tester/rt/coverage.py
 >>>  create mode 100644 tester/rtems/testing/coverage/
 symbol-sets.ini
 >>>
 >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
 >>> new file mode 100644
 >>> index 000..25fbb9d
 >>> --- /dev/null
 >>> +++ b/tester/rt/coverage.py
 >>> @@ -0,0 +1,379 @@
 >>> +#
 >>> +# RTEMS Tools Project (http://www.rtems.org/)
 >>> +# Copyright 2014 Krzysztof Miesowicz (
 krzysztof.miesow...@gmail.com)
 >>> +# All rights reserved.
 >>> +#
 >>> +# This file is part of the RTEMS Tools package in
 'rtems-tools'.
 >>> +#
 >>> +# Redistribution and use in source and binary forms, with or
 without
 >>> +# modification, are permitted provided that the following
 conditions are
 >>> met:
 >>> +#
 >>> +# 1. Redistributions of source code must retain the above
 copyright
 >>> notice,
 >>> +# this list of conditions and the following disclaimer.
 >>> +#
 >>> +# 2. Redistributions in binary form must reproduce the above
 copyright
 >>> notice

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Joel Sherrill
On Thu, May 31, 2018 at 4:57 PM, Vijay Kumar Banerjee <
vijaykumar9...@gmail.com> wrote:

> On 1 June 2018 at 02:50, Joel Sherrill  wrote:
>
>>
>>
>> On Thu, May 31, 2018 at 4:15 PM, Cillian O'Donnell > > wrote:
>>
>>>
>>>
>>> On Thu, 31 May 2018, 22:03 Vijay Kumar Banerjee, <
>>> vijaykumar9...@gmail.com> wrote:
>>>
 On 1 June 2018 at 02:14, Cillian O'Donnell 
 wrote:

> There is now a seperate bsp config for coverage, leon3-qemu-cov. That
> is enough to trigger coverage now and --coverage could be reserved for
> picking sets, probably renamed to --coverage-sets=... Or require sets to 
> be
> chosen --coverage-sets=all or specific sets --coverage-sets=score,sapi,cor
> e
>
> Actually the idea of having separate bsp configs for cov
 in each of the bsps will create a lot of files. The intention is
 to make it simple for the user. just adding --coverage
 should run coverage analysis. There's a plan to include
 the 'coverage' section into the bsp ini file, and hence the user
 wouldn't
 have to keep switching the bsp config files.

>>>
>>> Actually that's exactly the way I had it working before Chris' recent
>>> changes, he had a look at the way it's working and chose to create seperate
>>> bsp config files. That may be the way he'd prefer. This was before the
>>> --coverage option had another use other than triggering coverage, so his
>>> thoughts may have changed on it.
>>>
>>
>> Chris should comment on the separate ini files. I think that might have
>> been
>> driven by couverture vs regular qemu before couverture was available from
>> the RSB.
>>
>> Okay, we wait for Chris to comment on it then.
>
>> I think it would be nice to have --coverage and if the BSP ini file
>> doesn't support
>> coverage, give an error.
>>
>>
> Is the set option in the Python and processed by covoar in a way that still
>> lets covoar be used on something besides RTEMS?
>>
>>
> yes, it is totally handled by the script to 'feed' covoar with the
> options,
> without changing the way it works.
>
> I have a question/doubt.
> By adding separate bsp config for cov. Are we not assuming that
> the provided bsp ini supports coverage ?
>

I think having two leon3 configurations like we do now is temporary
just to have something that works. Any changes to the coverage
version don't impact the baseline.

I am hoping Chris has an idea to unified these. :)


>
>
 The idea of modifying it to --coverage-sets=all ;
 --coverage-sets=set1,set2,set3. can surely be implemented
 in place of --coverage ; --coverage=set1,set2

> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
> vijaykumar9...@gmail.com> wrote:
>
>> On 1 June 2018 at 01:57, Cillian O'Donnell 
>> wrote:
>>
>>> So is it checking whether it's --coverage or --coverage=set1,set2?
>>> Are those the 2 possibilities your checking?
>>>
>>> Yes, right. :)
>>
>>> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
>>> vijaykumar9...@gmail.com> wrote:
>>>
 On 1 June 2018 at 01:19, Gedare Bloom  wrote:

> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>  wrote:
> > On 1 June 2018 at 01:07, Cillian O'Donnell <
> cpodonne...@gmail.com> wrote:
> >>
> >>
> >>
> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com>
> >> wrote:
> >>>
> >>> Add support in tester to run covoar and generate an html
> report to
> >>> display
> >>> the summary of the coverage reports generated from covoar.
> >>>
> >>> Co-authored-by : Cillian O'Donnell 
> >>> ---
> >>>  tester/rt/coverage.py | 379
> >>> ++
> >>>  tester/rt/test.py |  36 ++-
> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
> >>>  tester/rtems/testing/qemu.cfg |   4 +-
> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
> >>>  create mode 100644 tester/rt/coverage.py
> >>>  create mode 100644 tester/rtems/testing/coverage/
> symbol-sets.ini
> >>>
> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> >>> new file mode 100644
> >>> index 000..25fbb9d
> >>> --- /dev/null
> >>> +++ b/tester/rt/coverage.py
> >>> @@ -0,0 +1,379 @@
> >>> +#
> >>> +# RTEMS Tools Project (http://www.rtems.org/)
> >>> +# Copyright 2014 Krzysztof Miesowicz (
> krzysztof.miesow...@gmail.com)
> >>> +# All rights reserved.
> >>> +#
> >>> +# This file is part of the RTEMS Tools package in
> 'rtems-tools'.
> >>> +#
> >>> +# Redistribution and use in source a

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Vijay Kumar Banerjee
On Fri, 1 Jun 2018, 03:40 Joel Sherrill,  wrote:

>
>
> On Thu, May 31, 2018 at 4:57 PM, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com> wrote:
>
>> On 1 June 2018 at 02:50, Joel Sherrill  wrote:
>>
>>>
>>>
>>> On Thu, May 31, 2018 at 4:15 PM, Cillian O'Donnell <
>>> cpodonne...@gmail.com> wrote:
>>>


 On Thu, 31 May 2018, 22:03 Vijay Kumar Banerjee, <
 vijaykumar9...@gmail.com> wrote:

> On 1 June 2018 at 02:14, Cillian O'Donnell 
> wrote:
>
>> There is now a seperate bsp config for coverage, leon3-qemu-cov. That
>> is enough to trigger coverage now and --coverage could be reserved for
>> picking sets, probably renamed to --coverage-sets=... Or require sets to 
>> be
>> chosen --coverage-sets=all or specific sets 
>> --coverage-sets=score,sapi,core
>>
>> Actually the idea of having separate bsp configs for cov
> in each of the bsps will create a lot of files. The intention is
> to make it simple for the user. just adding --coverage
> should run coverage analysis. There's a plan to include
> the 'coverage' section into the bsp ini file, and hence the user
> wouldn't
> have to keep switching the bsp config files.
>

 Actually that's exactly the way I had it working before Chris' recent
 changes, he had a look at the way it's working and chose to create seperate
 bsp config files. That may be the way he'd prefer. This was before the
 --coverage option had another use other than triggering coverage, so his
 thoughts may have changed on it.

>>>
>>> Chris should comment on the separate ini files. I think that might have
>>> been
>>> driven by couverture vs regular qemu before couverture was available from
>>> the RSB.
>>>
>>> Okay, we wait for Chris to comment on it then.
>>
>>> I think it would be nice to have --coverage and if the BSP ini file
>>> doesn't support
>>> coverage, give an error.
>>>
>>>
>> Is the set option in the Python and processed by covoar in a way that
>>> still
>>> lets covoar be used on something besides RTEMS?
>>>
>>>
>> yes, it is totally handled by the script to 'feed' covoar with the
>> options,
>> without changing the way it works.
>>
>> I have a question/doubt.
>> By adding separate bsp config for cov. Are we not assuming that
>> the provided bsp ini supports coverage ?
>>
>
> I think having two leon3 configurations like we do now is temporary
> just to have something that works. Any changes to the coverage
> version don't impact the baseline.
>
Understood. Thanks.


> I am hoping Chris has an idea to unified these. :)
>
>
>>
>>
> The idea of modifying it to --coverage-sets=all ;
> --coverage-sets=set1,set2,set3. can surely be implemented
> in place of --coverage ; --coverage=set1,set2
>
>> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
>> vijaykumar9...@gmail.com> wrote:
>>
>>> On 1 June 2018 at 01:57, Cillian O'Donnell 
>>> wrote:
>>>
 So is it checking whether it's --coverage or --coverage=set1,set2?
 Are those the 2 possibilities your checking?

 Yes, right. :)
>>>
 On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
 vijaykumar9...@gmail.com> wrote:

> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>
>> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>>  wrote:
>> > On 1 June 2018 at 01:07, Cillian O'Donnell <
>> cpodonne...@gmail.com> wrote:
>> >>
>> >>
>> >>
>> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
>> vijaykumar9...@gmail.com>
>> >> wrote:
>> >>>
>> >>> Add support in tester to run covoar and generate an html
>> report to
>> >>> display
>> >>> the summary of the coverage reports generated from covoar.
>> >>>
>> >>> Co-authored-by : Cillian O'Donnell 
>> >>> ---
>> >>>  tester/rt/coverage.py | 379
>> >>> ++
>> >>>  tester/rt/test.py |  36 ++-
>> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>> >>>  tester/rtems/testing/qemu.cfg |   4 +-
>> >>>  5 files changed, 446 insertions(+), 12 deletions(-)
>> >>>  create mode 100644 tester/rt/coverage.py
>> >>>  create mode 100644
>> tester/rtems/testing/coverage/symbol-sets.ini
>> >>>
>> >>> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
>> >>> new file mode 100644
>> >>> index 000..25fbb9d
>> >>> --- /dev/null
>> >>> +++ b/tester/rt/coverage.py
>> >>> @@ -0,0 +1,379 @@
>> >>> +#
>> >>> +# RTEMS Tools Project (http://www.rtems.org/)
>> >>> +# Copyright 2014 Krzysztof Miesowicz (
>> k

Re: [PATCH v2] tester: Add script to generate html coverage report from covoar output

2018-05-31 Thread Joel Sherrill
Just chatted with Chris. The coverage BSP ini file was a temporary
measure as I thought.

Make a list of all the ideas we have had for improvements. We want
the code to get onto master.

The list should be converted to Trac tickets very soon. Then we can
decide which are critical for GSoC, which Chris or I will work on, and
which are part of your GSoC.

--joel

On Thu, May 31, 2018 at 5:18 PM, Vijay Kumar Banerjee <
vijaykumar9...@gmail.com> wrote:

>
>
> On Fri, 1 Jun 2018, 03:40 Joel Sherrill,  wrote:
>
>>
>>
>> On Thu, May 31, 2018 at 4:57 PM, Vijay Kumar Banerjee <
>> vijaykumar9...@gmail.com> wrote:
>>
>>> On 1 June 2018 at 02:50, Joel Sherrill  wrote:
>>>


 On Thu, May 31, 2018 at 4:15 PM, Cillian O'Donnell <
 cpodonne...@gmail.com> wrote:

>
>
> On Thu, 31 May 2018, 22:03 Vijay Kumar Banerjee, <
> vijaykumar9...@gmail.com> wrote:
>
>> On 1 June 2018 at 02:14, Cillian O'Donnell 
>> wrote:
>>
>>> There is now a seperate bsp config for coverage, leon3-qemu-cov.
>>> That is enough to trigger coverage now and --coverage could be reserved 
>>> for
>>> picking sets, probably renamed to --coverage-sets=... Or require sets 
>>> to be
>>> chosen --coverage-sets=all or specific sets --coverage-sets=score,sapi,
>>> core
>>>
>>> Actually the idea of having separate bsp configs for cov
>> in each of the bsps will create a lot of files. The intention is
>> to make it simple for the user. just adding --coverage
>> should run coverage analysis. There's a plan to include
>> the 'coverage' section into the bsp ini file, and hence the user
>> wouldn't
>> have to keep switching the bsp config files.
>>
>
> Actually that's exactly the way I had it working before Chris' recent
> changes, he had a look at the way it's working and chose to create 
> seperate
> bsp config files. That may be the way he'd prefer. This was before the
> --coverage option had another use other than triggering coverage, so his
> thoughts may have changed on it.
>

 Chris should comment on the separate ini files. I think that might have
 been
 driven by couverture vs regular qemu before couverture was available
 from
 the RSB.

 Okay, we wait for Chris to comment on it then.
>>>
 I think it would be nice to have --coverage and if the BSP ini file
 doesn't support
 coverage, give an error.


>>> Is the set option in the Python and processed by covoar in a way that
 still
 lets covoar be used on something besides RTEMS?


>>> yes, it is totally handled by the script to 'feed' covoar with the
>>> options,
>>> without changing the way it works.
>>>
>>> I have a question/doubt.
>>> By adding separate bsp config for cov. Are we not assuming that
>>> the provided bsp ini supports coverage ?
>>>
>>
>> I think having two leon3 configurations like we do now is temporary
>> just to have something that works. Any changes to the coverage
>> version don't impact the baseline.
>>
> Understood. Thanks.
>
>
>> I am hoping Chris has an idea to unified these. :)
>>
>>
>>>
>>>
>> The idea of modifying it to --coverage-sets=all ;
>> --coverage-sets=set1,set2,set3. can surely be implemented
>> in place of --coverage ; --coverage=set1,set2
>>
>>> On Thu, 31 May 2018, 21:29 Vijay Kumar Banerjee, <
>>> vijaykumar9...@gmail.com> wrote:
>>>
 On 1 June 2018 at 01:57, Cillian O'Donnell 
 wrote:

> So is it checking whether it's --coverage or --coverage=set1,set2?
> Are those the 2 possibilities your checking?
>
> Yes, right. :)

> On Thu, 31 May 2018, 20:52 Vijay Kumar Banerjee, <
> vijaykumar9...@gmail.com> wrote:
>
>> On 1 June 2018 at 01:19, Gedare Bloom  wrote:
>>
>>> On Thu, May 31, 2018 at 3:47 PM, Vijay Kumar Banerjee
>>>  wrote:
>>> > On 1 June 2018 at 01:07, Cillian O'Donnell <
>>> cpodonne...@gmail.com> wrote:
>>> >>
>>> >>
>>> >>
>>> >> On 31 May 2018 at 19:07, Vijay Kumar Banerjee <
>>> vijaykumar9...@gmail.com>
>>> >> wrote:
>>> >>>
>>> >>> Add support in tester to run covoar and generate an html
>>> report to
>>> >>> display
>>> >>> the summary of the coverage reports generated from covoar.
>>> >>>
>>> >>> Co-authored-by : Cillian O'Donnell 
>>> >>> ---
>>> >>>  tester/rt/coverage.py | 379
>>> >>> ++
>>> >>>  tester/rt/test.py |  36 ++-
>>> >>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |   3 +-
>>> >>>  tester/rtems/testing/coverage/symbol-sets.ini |  36 +++
>>> >>>  tester/rtems/testing/qemu.cfg |   4 +-
>>> >>>  5 files

[PATCH v2] c-user: Fix rtems_region_create() return status

2018-05-31 Thread Sebastian Huber
---
 c-user/region_manager.rst | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/c-user/region_manager.rst b/c-user/region_manager.rst
index 1bebd8a..6a894d7 100644
--- a/c-user/region_manager.rst
+++ b/c-user/region_manager.rst
@@ -255,17 +255,22 @@ DIRECTIVE STATUS CODES:
- ``id`` is NULL
  * - ``RTEMS_INVALID_ADDRESS``
- ``starting_address`` is NULL
- * - ``RTEMS_INVALID_ADDRESS``
-   - address not on four byte boundary
  * - ``RTEMS_TOO_MANY``
- too many regions created
  * - ``RTEMS_INVALID_SIZE``
- invalid page size
+ * - ``RTEMS_INVALID_SIZE``
+   - the memory area defined by the starting address and the length
+ parameters is too small
 
 DESCRIPTION:
-This directive creates a region from a physically contiguous memory space
-which starts at starting_address and is length bytes long.  Segments
-allocated from the region will be a multiple of page_size bytes in length.
+This directive creates a region from a contiguous memory area
+which starts at starting_address and is length bytes long.  The memory area
+must be large enough to contain some internal region administration data.
+Segments allocated from the region will be a multiple of page_size bytes in
+length.  The specified page size will be aligned to an
+architecture-specific minimum alignment if necessary.
+
 The assigned region id is returned in id.  This region id is used as an
 argument to other region related directives to access the region.
 
@@ -279,10 +284,6 @@ DESCRIPTION:
 ``RTEMS_FIFO`` in attribute_set or selecting ``RTEMS_DEFAULT_ATTRIBUTES``
 will cause waiting tasks to be serviced in First In-First Out order.
 
-The ``starting_address`` parameter must be aligned on a four byte boundary.
-The ``page_size`` parameter must be a multiple of four greater than or
-equal to eight.
-
 NOTES:
 This directive will obtain the allocator mutex and may cause the calling
 task to be preempted.
-- 
2.13.6

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] Add RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE

2018-05-31 Thread Sebastian Huber
An invalid heap usage such as a double free is usually a fatal error
since this indicates a use after free.  Replace the use of printk() in
free() with a fatal error.

Update #3437.
---
 cpukit/include/rtems/score/interr.h | 7 +++
 cpukit/libcsupport/src/free.c   | 7 +--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/cpukit/include/rtems/score/interr.h 
b/cpukit/include/rtems/score/interr.h
index 3144952716..f09072d5fb 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -131,6 +131,13 @@ typedef enum {
   RTEMS_FATAL_SOURCE_PANIC = 11,
 
   /**
+   * @brief Fatal source for invalid C program heap frees via free().
+   *
+   * The fatal code is the bad pointer.
+   */
+  RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE = 12,
+
+  /**
* @brief The last available fatal source.
*
* This enum value ensures that the enum type needs at least 32-bits for
diff --git a/cpukit/libcsupport/src/free.c b/cpukit/libcsupport/src/free.c
index 90209580db..d8dd2bdb0e 100644
--- a/cpukit/libcsupport/src/free.c
+++ b/cpukit/libcsupport/src/free.c
@@ -38,12 +38,7 @@ void free(
   }
 
   if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) {
-printk( "Program heap: free of bad pointer %p -- range %p - %p \n",
-  ptr,
-  (void*) RTEMS_Malloc_Heap->area_begin,
-  (void*) RTEMS_Malloc_Heap->area_end
-);
+rtems_fatal( RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE, (rtems_fatal_code) ptr 
);
   }
-
 }
 #endif
-- 
2.13.6

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] c-user: RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE

2018-05-31 Thread Sebastian Huber
Close #3437.
---
 c-user/fatal_error.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/c-user/fatal_error.rst b/c-user/fatal_error.rst
index 7945030..305de23 100644
--- a/c-user/fatal_error.rst
+++ b/c-user/fatal_error.rst
@@ -127,6 +127,10 @@ RTEMS_FATAL_SOURCE_SMP (10)
 RTEMS_FATAL_SOURCE_PANIC (11)
 Fatal source of :c:func:`rtems_panic`, see :ref:`rtems_panic`.
 
+RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE (12)
+Fatal source for invalid C program heap frees via :c:func:`free`.  The
+fatal code is the bad pointer.
+
 .. _internal_errors:
 
 Internal Error Codes
-- 
2.13.6

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel