Skip to content

Commit

Permalink
Merge branch 'bmw-software-engineering:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TannazVhdBMWExt authored Dec 11, 2024
2 parents 0d854ef + b6f3095 commit 5dfff31
Show file tree
Hide file tree
Showing 41 changed files with 698 additions and 79 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*~
*.pyc
bazel-*
launch.json

*.egg-info
build
Expand Down
29 changes: 16 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@

### 0.9.21-dev

* `lobster-html-report` has the following updates.
* Filter items by status (Ok, Missing, Partial, Warning, Justified)
* Hide/Unhide Issues.
* Search in issues and detailed report.

* Add support to view version for lobster tools for following tools:
- `lobster-ci-report`
- `lobster-codebeamer`
- `lobster-cpp`
- `lobster-cpptest`
- `lobster-gtest`
- `lobster-html-report`
- `lobster-json`
- `lobster-online-report`
- `lobster-python`
- `lobster-report`
- `lobster-trlc`

### 0.9.20

Expand All @@ -24,19 +40,6 @@
* `lobster-codebeamer`
* `lobster-report`

* Add support to view version for lobster tools for following tools:
- `lobster-ci-report`
- `lobster-codebeamer`
- `lobster-cpp`
- `lobster-cpptest`
- `lobster-gtest`
- `lobster-html-report`
- `lobster-json`
- `lobster-online-report`
- `lobster-python`
- `lobster-report`
- `lobster-trlc`

* `lobster-gtest` accepts XML nodes other than `testcase`, but ignores them.

### 0.9.19
Expand Down
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ integration-tests: packages

system-tests:
mkdir -p docs
make -B -C tests-system/lobster-trlc
make -B -C tests-system/lobster-json
make -B -C tests-system/lobster-python
make -B -C tests-system TOOL=lobster-json
make -B -C tests-system TOOL=lobster-trlc
make -B -C tests-system TOOL=lobster-python

unit-tests:
coverage run -p \
Expand Down Expand Up @@ -92,9 +92,9 @@ full-release:
coverage:
coverage combine -q
coverage html --rcfile=coverage.cfg
coverage report --rcfile=coverage.cfg --fail-under=66
coverage report --rcfile=coverage.cfg --fail-under=62

test: system-tests unit-tests
test: clean-coverage system-tests unit-tests
make coverage
util/check_local_modifications.sh

Expand Down Expand Up @@ -149,3 +149,9 @@ unit-tests.lobster-%:
system-tests.lobster-%:
$(eval TOOL_PATH := $(subst -,/,$*))
python3 tests-system/lobster-trlc-system-test.py $(TOOL_PATH);

clean-coverage:
@rm -rf htmlcov
@find . -name '.coverage*' -type f -delete
@find . -name '*.pyc' -type f -delete
@echo "All .coverage, .coverage.* and *.pyc files deleted."
5 changes: 5 additions & 0 deletions lobster/html/htmldoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def __init__(self, title, subtitle):
}
self.scripts = []
self.body = []
self.css_files = []

def add_line(self, line):
assert isinstance(line, str)
Expand Down Expand Up @@ -293,6 +294,10 @@ def render(self):
rv.append(" %s: %s;" % (attr, value))
rv.append("}")
rv.append("</style>")

# add css files that are appended to self.files
for css_file in self.css_files:
rv.append(f"<link rel='stylesheet' href={css_file}>")
rv.append("</head>")
rv.append("<body>")

Expand Down
139 changes: 139 additions & 0 deletions lobster/tools/core/html_report/assets/html_report.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
.button {
background-color: #818589;
border: none;
border-radius: 5px;
color: white;
padding: 12px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
margin: 4px 2px;
cursor: pointer
}

.button active:before {
content: ;
position: absolute;
left: 0;
top: 0;
display: inline-block;
width: 0;
height: 0;
border-style: solid;
border-width: 15px 15px 0 0;
border-color: #333 transparent transparent transparent
}

.buttonActive.button {
text-decoration: none;
border: 5px solid #000000
}

.buttonOK {
background-color: #04AA6D;
color: white;
border: 2px solid #04AA6D;
border-radius: 5px
}

.buttonOK:hover {
background-color: #026641;
color: white;
border: 2px solid #026641
}

.buttonActive.buttonOK {
text-decoration: none;
border: 5px solid #026641
}

.buttonPartial {
background-color: #17a2b8;
color: white;
border: 2px solid #17a2b8;
border-radius: 5px
}

.buttonPartial:hover {
background-color: #0e616e;
color: white;
border: 2px solid #0e616e
}

.buttonActive.buttonPartial {
text-decoration: none;
border: 5px solid #0e616e
}

.buttonMissing {
background-color: #f44336;
color: white;
border: 2px solid #f44336;
border-radius: 5px
}

.buttonMissing:hover {
background-color: #a91409;
color: white;
border: 2px solid #a91409
}

.buttonActive.buttonMissing {
text-decoration: none;
border: 5px solid #a91409
}

.buttonJustified {
background-color: #6c757d;
color: white;
border: 2px solid #6c757d;
border-radius: 5px
}

.buttonJustified:hover {
background-color: #41464b;
color: white;
border: 2px solid #41464b
}

.buttonActive.buttonJustified {
text-decoration: none;
border: 5px solid #41464b
}

.buttonWarning {
background-color: #ffbf00;
color: white;
border: 2px solid #ffbf00;
border-radius: 5px
}

.buttonWarning:hover {
background-color: #997300;
color: white;
border: 2px solid #997300
}

.buttonActive.buttonWarning {
text-decoration: none;
border: 5px solid #997300
}

.buttonBlue {
background-color: #0000ff;
color: white;
border: 2px solid #0000ff;
border-radius: 5px
}

.buttonBlue:hover {
background-color: #000099;
color: white;
border: 2px solid #000099
}

.buttonActive.buttonBlue {
text-decoration: none;
border: 5px solid #000099
}
87 changes: 87 additions & 0 deletions lobster/tools/core/html_report/assets/html_report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
function buttonFilter(filter) {
var elms = document.getElementsByTagName("div");
var issue_elms = document.getElementsByClassName("issue");
for (i = 0; i < elms.length; i++) {
if (elms[i].id.startsWith("item-")) {
console.log("elms[i].className ", elms[i].className)
if (filter == "all") {
elms[i].style.display = "block";
} else if (elms[i].className == "item-" + filter) {
elms[i].style.display = "block";
} else {
elms[i].style.display = "none";
}
}
}
// filter the issues list based on the issue filter button clicked
for (i = 0; i < issue_elms.length; i++) {
console.log("log ", issue_elms[i].className)
if (filter == "all") {
issue_elms[i].style.display = "list-item";
} else if (issue_elms[i].className == "issue issue-" + filter) {
issue_elms[i].style.display = "list-item";
} else {
issue_elms[i].style.display = "none";
}
}
activeButton(filter);
//call the search filering which could have been overwritten by the current filtering
searchItem();
}


function activeButton(filter) {
var elms = document.getElementsByTagName("button");
console.log("the click buitton is " + filter);
for (i = 0; i < elms.length; i++) {
if (elms[i].className.includes("buttonActive")) {
console.log("elem active found : " + elms[i].className);
elms[i].className = elms[i].className.replace("buttonActive", "");
} else if (elms[i].className.toLowerCase().includes("button" + filter.toLowerCase())) {
console.log("elem to be activated found : " + elms[i].className);
elms[i].className = elms[i].className + " buttonActive";
}
}
}


function ToggleIssues() {
var div_issue = document.getElementById("issues-section");
if (div_issue.style.display == "block" || div_issue.style.display == "") {
div_issue.style.display = "none";
document.getElementById("BtnToggleIssue").innerHTML = "Show Issues";
document.getElementById("BtnToggleIssue").className = document.getElementById("BtnToggleIssue").className + " buttonActive";
} else {
div_issue.style = 'display: block; flex-direction: column; height: 200px;' +
'overflow:auto;';
document.getElementById("BtnToggleIssue").innerHTML = "Hide Issues";
document.getElementById("BtnToggleIssue").className = document.getElementById("BtnToggleIssue").className.replace("buttonActive", "");
}
}


function searchItem() {
var input = document.getElementById('search').value
input = input.toLowerCase();

var divs = document.getElementsByClassName('item-name');
for (i = 0; i < divs.length; i++) {
var title = divs[i].parentNode.getAttribute("title");
// get requirement name: 2nd part when we cut the long string with /svg
var reqname = divs[i].innerHTML.toLowerCase().split("</svg>").pop();
reqname = reqname.split(" ").pop();
if (reqname.includes(input)) {
// the search pattern has been found, if this elem has the title "hidden-not-matching", put it back to diplayed
if (title) {
if (title.startsWith("hidden-not-matching")) {
divs[i].parentNode.style.display = "block";
}
}
divs[i].parentNode.setAttribute("title", "matching-" + input)
} else {
// not maching, we hide
divs[i].parentNode.setAttribute("title", "hidden-not-matching")
divs[i].parentNode.style.display = "none";
}
}
}
Loading

0 comments on commit 5dfff31

Please sign in to comment.