diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e5d8a1..fed5ba5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,15 @@ ## Changelog -### 0.9.17-dev +### 0.9.17 + +* The `lobster-python` tool now adds the line number to the function + identifier. This supports situations where different functions have + the same name + +* The `lobster-json` tool now adds the filename to the test identifier. + This allows to have multiple json elements with the same name in + different source files * The `lobster-codebeamer` tool now uses codebeamer api v3 diff --git a/integration-tests/projects/basic/report.reference_output b/integration-tests/projects/basic/report.reference_output index b757a8d6..f728f25d 100644 --- a/integration-tests/projects/basic/report.reference_output +++ b/integration-tests/projects/basic/report.reference_output @@ -91,8 +91,8 @@ ], "ref_down": [ "simulink exclusive_or/My_Exclusive_Or", - "json XOR Test 1", - "json XOR Test 2" + "json example.json:XOR Test 1", + "json example.json:XOR Test 2" ], "tracing_status": "MISSING", "framework": "TRLC", @@ -481,7 +481,7 @@ "status": null }, { - "tag": "json XOR Test 1", + "tag": "json example.json:XOR Test 1", "location": { "kind": "github", "gh_root": "https://github.com/bmw-software-engineering/lobster", @@ -489,7 +489,7 @@ "file": "integration-tests/projects/basic/example.json", "line": null }, - "name": "XOR Test 1", + "name": "example.json:XOR Test 1", "messages": [], "just_up": [], "just_down": [], @@ -504,7 +504,7 @@ "status": null }, { - "tag": "json XOR Test 2", + "tag": "json example.json:XOR Test 2", "location": { "kind": "github", "gh_root": "https://github.com/bmw-software-engineering/lobster", @@ -512,7 +512,7 @@ "file": "integration-tests/projects/basic/example.json", "line": null }, - "name": "XOR Test 2", + "name": "example.json:XOR Test 2", "messages": [], "just_up": [], "just_down": [], @@ -527,7 +527,7 @@ "status": null }, { - "tag": "json Potato Test 1", + "tag": "json example.json:Potato Test 1", "location": { "kind": "github", "gh_root": "https://github.com/bmw-software-engineering/lobster", @@ -535,7 +535,7 @@ "file": "integration-tests/projects/basic/example.json", "line": null }, - "name": "Potato Test 1", + "name": "example.json:Potato Test 1", "messages": [], "just_up": [ "Unlinked on purpose" diff --git a/integration-tests/projects/filter/report.reference_output b/integration-tests/projects/filter/report.reference_output index f20fe9a9..0085a7bd 100644 --- a/integration-tests/projects/filter/report.reference_output +++ b/integration-tests/projects/filter/report.reference_output @@ -11,7 +11,7 @@ "tag": "req sysreq_example.lobster_example", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/sysreq_example.trlc", "line": 4 @@ -36,7 +36,7 @@ "tag": "req sysreq_example.req_implication", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/sysreq_example.trlc", "line": 11 @@ -60,7 +60,7 @@ "tag": "req sysreq_example.req_xor", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/sysreq_example.trlc", "line": 19 @@ -91,7 +91,7 @@ "tag": "req softreq_example.req_implication", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/softreq_example.trlc", "line": 5 @@ -107,8 +107,8 @@ ], "ref_down": [ "cpp foo.cpp:implication:3", - "json test_example.json.Implication Test 1", - "json test_example.json.Implication Test 2" + "json test_example.json:Implication Test 1", + "json test_example.json:Implication Test 2" ], "tracing_status": "OK", "framework": "TRLC", @@ -120,7 +120,7 @@ "tag": "req softreq_example.req_xor", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/softreq_example.trlc", "line": 17 @@ -136,10 +136,10 @@ ], "ref_down": [ "cpp foo.cpp:exclusive_or:9", - "json test_example.json.XOR Test 1", - "json test_example.json.XOR Test 2", - "json test_example.json.XOR Test 3", - "json test_example.json.XOR Test 4" + "json test_example.json:XOR Test 1", + "json test_example.json:XOR Test 2", + "json test_example.json:XOR Test 3", + "json test_example.json:XOR Test 4" ], "tracing_status": "OK", "framework": "TRLC", @@ -158,7 +158,7 @@ "tag": "cpp foo.cpp:implication:3", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/foo.cpp", "line": 3 @@ -180,7 +180,7 @@ "tag": "cpp foo.cpp:exclusive_or:9", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/foo.cpp", "line": 9 @@ -206,15 +206,15 @@ "kind": "activity", "items": [ { - "tag": "json test_example.json.Implication Test 1", + "tag": "json test_example.json:Implication Test 1", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/test_example.json", "line": null }, - "name": "test_example.json.Implication Test 1", + "name": "test_example.json:Implication Test 1", "messages": [], "just_up": [], "just_down": [], @@ -229,15 +229,15 @@ "status": null }, { - "tag": "json test_example.json.Implication Test 2", + "tag": "json test_example.json:Implication Test 2", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/test_example.json", "line": null }, - "name": "test_example.json.Implication Test 2", + "name": "test_example.json:Implication Test 2", "messages": [], "just_up": [], "just_down": [], @@ -252,15 +252,15 @@ "status": null }, { - "tag": "json test_example.json.XOR Test 1", + "tag": "json test_example.json:XOR Test 1", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/test_example.json", "line": null }, - "name": "test_example.json.XOR Test 1", + "name": "test_example.json:XOR Test 1", "messages": [], "just_up": [], "just_down": [], @@ -275,15 +275,15 @@ "status": null }, { - "tag": "json test_example.json.XOR Test 2", + "tag": "json test_example.json:XOR Test 2", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/test_example.json", "line": null }, - "name": "test_example.json.XOR Test 2", + "name": "test_example.json:XOR Test 2", "messages": [], "just_up": [], "just_down": [], @@ -298,15 +298,15 @@ "status": null }, { - "tag": "json test_example.json.XOR Test 3", + "tag": "json test_example.json:XOR Test 3", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/test_example.json", "line": null }, - "name": "test_example.json.XOR Test 3", + "name": "test_example.json:XOR Test 3", "messages": [], "just_up": [], "just_down": [], @@ -321,15 +321,15 @@ "status": null }, { - "tag": "json test_example.json.XOR Test 4", + "tag": "json test_example.json:XOR Test 4", "location": { "kind": "github", - "gh_root": "https://github_paulboegedev/paulboege/lobster", + "gh_root": "https://github.com/bmw-software-engineering/lobster", "commit": "main", "file": "integration-tests/projects/filter/test_example.json", "line": null }, - "name": "test_example.json.XOR Test 4", + "name": "test_example.json:XOR Test 4", "messages": [], "just_up": [], "just_down": [], diff --git a/lobster/tools/json/json.py b/lobster/tools/json/json.py index b4317dbd..6cd70142 100755 --- a/lobster/tools/json/json.py +++ b/lobster/tools/json/json.py @@ -174,7 +174,8 @@ def process(cls, options, file_name): l_item = Activity( tag = Tracing_Tag(namespace = "json", - tag = item_name), + tag = "%s:%s" % + (file_name, item_name)), location = File_Reference(file_name), framework = "JSON", kind = "Test Vector") diff --git a/lobster/tools/python/python.py b/lobster/tools/python/python.py index 5d4ffaf7..1e545f4c 100755 --- a/lobster/tools/python/python.py +++ b/lobster/tools/python/python.py @@ -90,7 +90,11 @@ def fqn(self): rv = self.parent.fqn() + "." else: rv = "" - rv += self.name + if self.location.line is not None and \ + isinstance(self, Python_Function): + rv += f"{self.name}:{str(self.location.line)}" + else: + rv += self.name return rv def lobster_tag(self): diff --git a/lobster/tools/trlc/trlc.py b/lobster/tools/trlc/trlc.py index 801a411c..a1c02dc8 100644 --- a/lobster/tools/trlc/trlc.py +++ b/lobster/tools/trlc/trlc.py @@ -19,6 +19,7 @@ import os import re +import sys import argparse from copy import copy @@ -448,4 +449,4 @@ def main(): if __name__ == "__main__": - main() + sys.exit(main()) diff --git a/lobster/version.py b/lobster/version.py index 9cb5ffc0..3b39b6e1 100644 --- a/lobster/version.py +++ b/lobster/version.py @@ -18,7 +18,7 @@ # . VERSION_TUPLE = (0, 9, 17) -VERSION_SUFFIX = "dev" +VERSION_SUFFIX = "" LOBSTER_VERSION = ("%u.%u.%u" % VERSION_TUPLE) + \ ("-%s" % VERSION_SUFFIX if VERSION_SUFFIX else "") diff --git a/test-system/lobster-json/basic.output b/test-system/lobster-json/basic.output index 02bb3cc3..3157c93e 100644 --- a/test-system/lobster-json/basic.output +++ b/test-system/lobster-json/basic.output @@ -3,14 +3,14 @@ lobster-json: wrote 6 items to basic.lobster { "data": [ { - "tag": "json Test_1", + "tag": "json ./basic.json:Test_1", "location": { "kind": "file", "file": "./basic.json", "line": null, "column": null }, - "name": "Test_1", + "name": "./basic.json:Test_1", "messages": [], "just_up": [], "just_down": [], @@ -23,14 +23,14 @@ lobster-json: wrote 6 items to basic.lobster "status": null }, { - "tag": "json Test_2", + "tag": "json ./basic.json:Test_2", "location": { "kind": "file", "file": "./basic.json", "line": null, "column": null }, - "name": "Test_2", + "name": "./basic.json:Test_2", "messages": [], "just_up": [], "just_down": [], @@ -40,14 +40,14 @@ lobster-json: wrote 6 items to basic.lobster "status": null }, { - "tag": "json Test_3", + "tag": "json ./basic.json:Test_3", "location": { "kind": "file", "file": "./basic.json", "line": null, "column": null }, - "name": "Test_3", + "name": "./basic.json:Test_3", "messages": [], "just_up": [], "just_down": [], @@ -61,14 +61,14 @@ lobster-json: wrote 6 items to basic.lobster "status": null }, { - "tag": "json Test_4", + "tag": "json ./basic.json:Test_4", "location": { "kind": "file", "file": "./basic.json", "line": null, "column": null }, - "name": "Test_4", + "name": "./basic.json:Test_4", "messages": [], "just_up": [], "just_down": [], @@ -78,14 +78,14 @@ lobster-json: wrote 6 items to basic.lobster "status": null }, { - "tag": "json Test_5", + "tag": "json ./basic.json:Test_5", "location": { "kind": "file", "file": "./basic.json", "line": null, "column": null }, - "name": "Test_5", + "name": "./basic.json:Test_5", "messages": [], "just_up": [], "just_down": [], @@ -98,14 +98,14 @@ lobster-json: wrote 6 items to basic.lobster "status": null }, { - "tag": "json Test_6", + "tag": "json ./basic.json:Test_6", "location": { "kind": "file", "file": "./basic.json", "line": null, "column": null }, - "name": "Test_6", + "name": "./basic.json:Test_6", "messages": [], "just_up": [], "just_down": [], diff --git a/test-system/lobster-json/basic2.output b/test-system/lobster-json/basic2.output index ca97315b..287d5a13 100644 --- a/test-system/lobster-json/basic2.output +++ b/test-system/lobster-json/basic2.output @@ -3,14 +3,14 @@ lobster-json: wrote 6 items to basic2.lobster { "data": [ { - "tag": "json basic2.1", + "tag": "json ./basic2.json:basic2.1", "location": { "kind": "file", "file": "./basic2.json", "line": null, "column": null }, - "name": "basic2.1", + "name": "./basic2.json:basic2.1", "messages": [], "just_up": [], "just_down": [], @@ -23,14 +23,14 @@ lobster-json: wrote 6 items to basic2.lobster "status": null }, { - "tag": "json basic2.2", + "tag": "json ./basic2.json:basic2.2", "location": { "kind": "file", "file": "./basic2.json", "line": null, "column": null }, - "name": "basic2.2", + "name": "./basic2.json:basic2.2", "messages": [], "just_up": [], "just_down": [], @@ -40,14 +40,14 @@ lobster-json: wrote 6 items to basic2.lobster "status": null }, { - "tag": "json basic2.3", + "tag": "json ./basic2.json:basic2.3", "location": { "kind": "file", "file": "./basic2.json", "line": null, "column": null }, - "name": "basic2.3", + "name": "./basic2.json:basic2.3", "messages": [], "just_up": [], "just_down": [], @@ -61,14 +61,14 @@ lobster-json: wrote 6 items to basic2.lobster "status": null }, { - "tag": "json basic2.4", + "tag": "json ./basic2.json:basic2.4", "location": { "kind": "file", "file": "./basic2.json", "line": null, "column": null }, - "name": "basic2.4", + "name": "./basic2.json:basic2.4", "messages": [], "just_up": [], "just_down": [], @@ -78,14 +78,14 @@ lobster-json: wrote 6 items to basic2.lobster "status": null }, { - "tag": "json basic2.5", + "tag": "json ./basic2.json:basic2.5", "location": { "kind": "file", "file": "./basic2.json", "line": null, "column": null }, - "name": "basic2.5", + "name": "./basic2.json:basic2.5", "messages": [], "just_up": [], "just_down": [], @@ -98,14 +98,14 @@ lobster-json: wrote 6 items to basic2.lobster "status": null }, { - "tag": "json basic2.6", + "tag": "json ./basic2.json:basic2.6", "location": { "kind": "file", "file": "./basic2.json", "line": null, "column": null }, - "name": "basic2.6", + "name": "./basic2.json:basic2.6", "messages": [], "just_up": [], "just_down": [], diff --git a/test-system/lobster-json/nested.output b/test-system/lobster-json/nested.output index 29da7eb6..387965f9 100644 --- a/test-system/lobster-json/nested.output +++ b/test-system/lobster-json/nested.output @@ -3,14 +3,14 @@ lobster-json: wrote 6 items to nested.lobster { "data": [ { - "tag": "json Test_1", + "tag": "json ./nested.json:Test_1", "location": { "kind": "file", "file": "./nested.json", "line": null, "column": null }, - "name": "Test_1", + "name": "./nested.json:Test_1", "messages": [], "just_up": [], "just_down": [], @@ -23,14 +23,14 @@ lobster-json: wrote 6 items to nested.lobster "status": null }, { - "tag": "json Test_2", + "tag": "json ./nested.json:Test_2", "location": { "kind": "file", "file": "./nested.json", "line": null, "column": null }, - "name": "Test_2", + "name": "./nested.json:Test_2", "messages": [], "just_up": [], "just_down": [], @@ -40,14 +40,14 @@ lobster-json: wrote 6 items to nested.lobster "status": null }, { - "tag": "json Test_3", + "tag": "json ./nested.json:Test_3", "location": { "kind": "file", "file": "./nested.json", "line": null, "column": null }, - "name": "Test_3", + "name": "./nested.json:Test_3", "messages": [], "just_up": [], "just_down": [], @@ -61,14 +61,14 @@ lobster-json: wrote 6 items to nested.lobster "status": null }, { - "tag": "json Test_4", + "tag": "json ./nested.json:Test_4", "location": { "kind": "file", "file": "./nested.json", "line": null, "column": null }, - "name": "Test_4", + "name": "./nested.json:Test_4", "messages": [], "just_up": [], "just_down": [], @@ -78,14 +78,14 @@ lobster-json: wrote 6 items to nested.lobster "status": null }, { - "tag": "json Test_5", + "tag": "json ./nested.json:Test_5", "location": { "kind": "file", "file": "./nested.json", "line": null, "column": null }, - "name": "Test_5", + "name": "./nested.json:Test_5", "messages": [], "just_up": [], "just_down": [], @@ -98,14 +98,14 @@ lobster-json: wrote 6 items to nested.lobster "status": null }, { - "tag": "json Test_6", + "tag": "json ./nested.json:Test_6", "location": { "kind": "file", "file": "./nested.json", "line": null, "column": null }, - "name": "Test_6", + "name": "./nested.json:Test_6", "messages": [], "just_up": [], "just_down": [], diff --git a/test-system/lobster-json/single1.output b/test-system/lobster-json/single1.output index 8f90792b..bc1d08b9 100644 --- a/test-system/lobster-json/single1.output +++ b/test-system/lobster-json/single1.output @@ -3,14 +3,14 @@ lobster-json: wrote 1 items to single1.lobster { "data": [ { - "tag": "json Single_1", + "tag": "json ./single1.json:Single_1", "location": { "kind": "file", "file": "./single1.json", "line": null, "column": null }, - "name": "Single_1", + "name": "./single1.json:Single_1", "messages": [], "just_up": [], "just_down": [], diff --git a/test-system/lobster-json/single3.output b/test-system/lobster-json/single3.output index f18ba85a..3adb6406 100644 --- a/test-system/lobster-json/single3.output +++ b/test-system/lobster-json/single3.output @@ -3,14 +3,14 @@ lobster-json: wrote 1 items to single3.lobster { "data": [ { - "tag": "json single3.1", + "tag": "json ./single3.json:single3.1", "location": { "kind": "file", "file": "./single3.json", "line": null, "column": null }, - "name": "single3.1", + "name": "./single3.json:single3.1", "messages": [], "just_up": [], "just_down": [], diff --git a/test-system/lobster-json/single4.output b/test-system/lobster-json/single4.output index ec340a0e..019a2950 100644 --- a/test-system/lobster-json/single4.output +++ b/test-system/lobster-json/single4.output @@ -3,14 +3,14 @@ lobster-json: wrote 1 items to single4.lobster { "data": [ { - "tag": "json single4.1", + "tag": "json ./single4.json:single4.1", "location": { "kind": "file", "file": "./single4.json", "line": null, "column": null }, - "name": "single4.1", + "name": "./single4.json:single4.1", "messages": [], "just_up": [], "just_down": [],