Skip to content

Commit

Permalink
Fix system test rbt-report-input-duplicate-definition
Browse files Browse the repository at this point in the history
- The `*.lobster` input files were missing for this test.
- The test was located at a wrong location, where the test was not executed at all.
  • Loading branch information
phiwuu committed Jan 23, 2025
1 parent ac89cf8 commit 4613a80
Show file tree
Hide file tree
Showing 16 changed files with 256 additions and 7 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DuplicateDefinitionTest.py:2: lobster error: duplicate definition of hello DuplicateDefinitionTest, previously defined at DuplicateDefinitionTest.py:1
DuplicateDefinitionTest.py:3: lobster error: duplicate definition of hello DuplicateDefinitionTest, previously defined at DuplicateDefinitionTest.py:1
DuplicateDefinitionTest.py:4: lobster error: duplicate definition of hello DuplicateDefinitionTest, previously defined at DuplicateDefinitionTest.py:1
lobster: aborting due to earlier errors.
lobster: aborting due to earlier errors.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--lobster-config=lobster.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"data": [
{
"tag": "hello DuplicateDefinitionTest",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 1,
"column": null
},
"name": "DuplicateDefinitionTest",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 2,
"column": null
},
"name": "DuplicateDefinitionTest",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 3,
"column": null
},
"name": "DuplicateDefinitionTest",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 4,
"column": null
},
"name": "DuplicateDefinitionTest",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
}
],
"generator": "lobster_hello",
"schema": "lobster-imp-trace",
"version": 3
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"schema": "lobster-report",
"version": 2,
"generator": "lobster_report",
"levels": [
{
"name": "Something",
"kind": "implementation",
"items": [
{
"tag": "hello DuplicateDefinitionTest 1",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 1,
"column": null
},
"name": "DuplicateDefinitionTest 1",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"tracing_status": "OK",
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest 2",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 2,
"column": null
},
"name": "DuplicateDefinitionTest 2",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"tracing_status": "OK",
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest 3",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 3,
"column": null
},
"name": "DuplicateDefinitionTest 3",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"tracing_status": "OK",
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest 4",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 4,
"column": null
},
"name": "DuplicateDefinitionTest 4",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"tracing_status": "OK",
"language": "Python",
"kind": "Function"
}
],
"coverage": 100.0
}
],
"policy": {
"Something": {
"name": "Something",
"kind": "implementation",
"traces": [],
"source": [
{
"file": "file.lobster",
"filters": []
}
],
"needs_tracing_up": false,
"needs_tracing_down": false,
"breakdown_requirements": []
}
},
"matrix": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--lobster-config=lobster.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"data": [
{
"tag": "hello DuplicateDefinitionTest 1",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 1,
"column": null
},
"name": "DuplicateDefinitionTest 1",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest 2",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 2,
"column": null
},
"name": "DuplicateDefinitionTest 2",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest 3",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 3,
"column": null
},
"name": "DuplicateDefinitionTest 3",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
},
{
"tag": "hello DuplicateDefinitionTest 4",
"location": {
"kind": "file",
"file": "DuplicateDefinitionTest.py",
"line": 4,
"column": null
},
"name": "DuplicateDefinitionTest 4",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"refs": [],
"language": "Python",
"kind": "Function"
}
],
"generator": "lobster_hello",
"schema": "lobster-imp-trace",
"version": 3
}
8 changes: 4 additions & 4 deletions tests-system/run_tool_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ def _compare_cmd_output(name: str, expected: str, actual: str) -> bool:


def _compare_results(setup: TestSetup, completed_process: CompletedProcess):
assert setup.expected_exit_code == completed_process.returncode, \
f"{setup.name}: Expected exit code is {setup.expected_exit_code}, " \
f"actual is {completed_process.returncode}!"

assert _compare_cmd_output(
name="STDOUT",
expected=setup.get_expected_stdout(),
Expand All @@ -181,6 +177,10 @@ def _compare_results(setup: TestSetup, completed_process: CompletedProcess):
actual=completed_process.stderr,
), "Command line output for STDERR is different!"

assert setup.expected_exit_code == completed_process.returncode, \
f"{setup.name}: Expected exit code is {setup.expected_exit_code}, " \
f"actual is {completed_process.returncode}!"

for expected_lobster_output_file_name in setup.expected_lobster_output_file_names:
expected = join(
setup.get_expected_output_path(),
Expand Down

0 comments on commit 4613a80

Please sign in to comment.