-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Changelog for git hashes, removed check modification checks fro…
…m ci.yml, restructured git hashes part in lobster-online-report, unit tests added
- Loading branch information
Showing
8 changed files
with
80 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests-system/lobster-online-report/rbt-valid-flow/valid-scenario/input/args.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
report-lobster.input | ||
report.lobster | ||
--out=expected-output.lobster |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# --parse-decorator trlc_reference requirement | ||
|
||
import potatolib | ||
|
||
def trlc_reference(requirement): | ||
# lobster-exclude: helper function | ||
def decorator(obj): | ||
return obj | ||
return decorator | ||
|
||
class Example: | ||
@trlc_reference(requirement="example.req_nor") | ||
def helper_function(a, b): | ||
# potato | ||
return a or b | ||
|
||
def nor(a, b): | ||
# lobster-trace: example.req_nor | ||
assert isinstance(a, bool) | ||
assert isinstance(b, bool) | ||
|
||
return not helper_function(a, b) |
38 changes: 37 additions & 1 deletion
38
tests-unit/lobster-core/online_report/test_online_report.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,40 @@ | ||
# please consider writing here your tests and set your tracing tags. | ||
# This file will be used in the tracing report | ||
# if any other file or files are used, make the needed | ||
# adjsutments to tracing report target. | ||
# adjsutments to tracing report target. | ||
import argparse | ||
import json | ||
import os | ||
import sys | ||
import unittest | ||
from contextlib import redirect_stdout | ||
from io import StringIO | ||
from os.path import dirname | ||
from pathlib import Path | ||
|
||
from lobster.tools.core.online_report.online_report import main | ||
|
||
|
||
class LobsterOnlineReportTests(unittest.TestCase): | ||
def setUp(self): | ||
self.input_file = str(Path(dirname(__file__), "data", "report.lobster")) | ||
self.online_report = "online-report.lobster" | ||
|
||
def test_valid_inputs(self): | ||
sys.argv = ["lobster-online-report", self.input_file, f'--out={self.online_report}'] | ||
with StringIO() as stdout, redirect_stdout(stdout): | ||
exit_code = main() | ||
output = stdout.getvalue() | ||
with open(self.online_report, 'r') as file: | ||
data = json.load(file) | ||
for level in data['levels']: | ||
for item in level['items']: | ||
with self.subTest(item): | ||
location = item['location'] | ||
if 'file' in location: | ||
self.assertIsNotNone(location.get('exec_commit_id')) | ||
self.assertEqual(exit_code, 0) | ||
self.assertIn(f"LOBSTER report {self.online_report} changed to use online references", output) | ||
|
||
def tearDown(self): | ||
os.remove(self.online_report) |