-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore fix #26
base: master
Are you sure you want to change the base?
Ignore fix #26
Changes from all commits
3aa967b
44b298d
32f39e4
d9e477f
d215168
b02bfea
15b8e17
4f76a32
d4d82e3
637e879
41976e3
6200e03
d36fb7a
9d0523f
cea7a5b
7dac845
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
.settings/ | ||
Debug/ | ||
.pydevproject | ||
venv/ | ||
setenv.sh | ||
fir.xml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Build Instructions | ||
|
||
These are the build instructions for using the example | ||
|
||
``` | ||
# export SYSTEMC_HOME="path to systemC release dir" | ||
$ make clean | ||
$ make | ||
$ make run | ||
``` | ||
|
||
# Test Instructions *(optional)* | ||
Optionally test the output using the following instructions | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DEFAULT_GOAL := validate_fir | ||
|
||
|
||
validate_fir: | ||
python3 validate_ucis_xml.py |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# test of xml output with pyucis | ||
|
||
This directory contains test code to validate the coverage_report.xml | ||
output for the fir example. It requires python3 and the [VENV.md](VENV.md) | ||
file shows how to setup a virtual environment for testing. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# venv notes | ||
|
||
# Create and activate the venv | ||
|
||
Do this once | ||
|
||
``` | ||
sudo apt-get install python3-venv | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
python3 -m pip install -r requirements.txt | ||
# test that usis can be imported | ||
python3 -c 'import ucis' | ||
alias bazel='/home/davis/bin/bazel-4.2.1-linux-x86_64' | ||
``` | ||
|
||
|
||
# Activate the venv | ||
|
||
``` | ||
. venv/bin/activate | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../examples/fir/coverage_results.xml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pyucis==0.0.5.20220416.1 | ||
pylint | ||
pyyaml | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Tests for ucis.""" | ||
|
||
import unittest | ||
from validate_ucis_xml import validate_ucis | ||
|
||
|
||
|
||
class UcisTest(unittest.TestCase): | ||
|
||
def test_validate_ucis_xml(self): | ||
self.assertTrue(validate_ucis('../../examples/fir/coverage_results.xml')) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" Test script to compare coverage_results.xml with spec | ||
|
||
Use pyucis to validate fir example coverage result generated | ||
by FC4SC against specification. | ||
""" | ||
|
||
from io import BytesIO | ||
from ucis.xml import validate_ucis_xml | ||
|
||
|
||
|
||
def validate_ucis(file_name): | ||
""" | ||
Validate UCIS function | ||
|
||
: arg file_name: The filename to validate | ||
: returns: status of validation. TODO:return | ||
""" | ||
rc = False | ||
|
||
try: | ||
with open(file_name, encoding='utf-8') as f: | ||
xml_file = BytesIO(bytes(bytearray(f.read(), encoding='utf-8'))) | ||
rc = validate_ucis_xml(xml_file) | ||
except: | ||
print("an exception occured") | ||
|
||
return rc | ||
|
||
|
||
def main() -> None: | ||
|
||
rc = validate_ucis('../../examples/fir/coverage_results.xml') | ||
return rc | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
rc = main() | ||
if rc: | ||
print("validation OK") | ||
else: | ||
print("validation Failure") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# venv notes | ||
|
||
# Create and activate the venv | ||
|
||
Do this once | ||
|
||
``` | ||
sudo apt-get install python3-venv | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
python3 -m pip install -r requirements.txt | ||
# test that usis can be imported | ||
python3 -c 'import ucis' | ||
alias bazel='/home/davis/bin/bazel-4.2.1-linux-x86_64' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what this alias does, but it looks hardcoded for specific user. Can it be removed? Otherwise it need to be generalized. |
||
``` | ||
|
||
|
||
# Activate the venv | ||
|
||
``` | ||
. venv/bin/activate | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
JFD/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like some local unneeded files? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Usage | ||
|
||
``` | ||
python3 report.py --xml_report foo.xml --yaml_out foo.yml | ||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pyucis==0.0.5.20220416.1 | ||
pylint | ||
pyyaml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason why name was changed? Space character in name is not allowed under UCIS standard?