-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate "basic" system tests of
lobster-json
Migrate the "basic" system test so that they can be executed with the `run_tool_tests.py` tool. Write requirements for these tests. `run_tool_tests.py` now deletes *.lobster files that were generated during test execution.
- Loading branch information
Showing
24 changed files
with
241 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
package json_req | ||
import req | ||
|
||
req.Software_Requirement Dummy_Requirement { | ||
req.Software_Requirement Synthetic_Tag_Name { | ||
description = ''' | ||
This is not really a requirement. It will be used only to generate a minimal tracing report for each tool. | ||
It can be deleted as soon as all the tools get their real requirements. | ||
If the command line option --name-attribute is not given, then the tool shall create | ||
a synthetic tag name based on the path of the JSON input file and an item counter. | ||
|
||
Note: The item counter does not need to be unique across files. | ||
It shall be unique at least for each input file separately. | ||
''' | ||
} | ||
|
||
req.Software_Requirement Dummy_Requirement_Unit_Test { | ||
req.Software_Requirement Name_Attribute { | ||
description = ''' | ||
This is not really a requirement. It will be used only to generate a minimal tracing report for each tool. | ||
It can be deleted as soon as all the tools get their real requirements. | ||
If the command line option --name-attribute is given, then the tool shall | ||
- use the value of the command line argument as JSON key of the JSON item | ||
- and use that obtained value as LOBSTER item tag name. | ||
''' | ||
} |
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 +1 @@ | ||
!**/expected-output/* | ||
!**/expected-output/* |
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
tests-system/lobster-json/rbt-name-attribute/attribute-given/expected-output/exit-code.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
2 changes: 0 additions & 2 deletions
2
tests-system/lobster-json/basic.output → ...bute-given/expected-output/output.lobster
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,5 +1,3 @@ | ||
lobster-json: wrote 6 items to basic.lobster | ||
========== | ||
{ | ||
"data": [ | ||
{ | ||
|
File renamed without changes.
1 change: 1 addition & 0 deletions
1
tests-system/lobster-json/rbt-name-attribute/attribute-given/expected-output/stdout.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
lobster-json: wrote 6 items to output.lobster |
4 changes: 4 additions & 0 deletions
4
tests-system/lobster-json/rbt-name-attribute/attribute-given/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--single | ||
--tag-attribute=tags | ||
--name-attribute=name | ||
--out=output.lobster |
1 change: 0 additions & 1 deletion
1
tests-system/lobster-json/basic2.input → ...ttribute/attribute-given/input/basic.json
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,3 @@ | ||
// --tag-attribute=tags | ||
[ | ||
{ | ||
"name" : "Test_1", | ||
|
22 changes: 22 additions & 0 deletions
22
tests-system/lobster-json/rbt-synthetic-tag-name/README.md
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 @@ | ||
If the `--name-attribute` option is not specified, | ||
then the tag name must be constructed based on the following two values: | ||
- path of the json file | ||
- item counter | ||
|
||
# Test case "flat-input-structure" | ||
- No files or directories are specified. | ||
The tool is expected to search for input files in the current working directory. | ||
- `--name-attribute` is not given. | ||
The tool is expected to construct LOBSTER item tags by taking the file name and | ||
appending an integer counter, starting at 1. | ||
This is implemented inside function `syn_test_name`, and it must handle all file | ||
paths as relative paths, because no input files were given explicitly. | ||
- `--out` is specified. | ||
The tool is expected to use that path name for the output file. | ||
- `--single` is specified to make the tool output predictable. | ||
|
||
# Test case "nested-input-structure" | ||
This is the same as the above test, except that its input file is nested in a | ||
sub-sub-directory. | ||
The tool is expected to take the names of the sub-directories into account when | ||
generating te tag name. |
1 change: 1 addition & 0 deletions
1
...em/lobster-json/rbt-synthetic-tag-name/flat-input-structure/expected-output/exit-code.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
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
Empty file.
1 change: 1 addition & 0 deletions
1
...ystem/lobster-json/rbt-synthetic-tag-name/flat-input-structure/expected-output/stdout.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
lobster-json: wrote 6 items to output.lobster |
3 changes: 3 additions & 0 deletions
3
tests-system/lobster-json/rbt-synthetic-tag-name/flat-input-structure/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--single | ||
--tag-attribute=tags | ||
--out=output.lobster |
1 change: 0 additions & 1 deletion
1
tests-system/lobster-json/basic.input → ...ame/flat-input-structure/input/basic.json
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,3 @@ | ||
// --tag-attribute=tags --name-attribute=name | ||
[ | ||
{ | ||
"name" : "Test_1", | ||
|
1 change: 1 addition & 0 deletions
1
.../lobster-json/rbt-synthetic-tag-name/nested-input-structure/expected-output/exit-code.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
119 changes: 119 additions & 0 deletions
119
...lobster-json/rbt-synthetic-tag-name/nested-input-structure/expected-output/output.lobster
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,119 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"tag": "json ./one/two/basic.json:one.two.basic.1", | ||
"location": { | ||
"kind": "file", | ||
"file": "./one/two/basic.json", | ||
"line": null, | ||
"column": null | ||
}, | ||
"name": "./one/two/basic.json:one.two.basic.1", | ||
"messages": [], | ||
"just_up": [], | ||
"just_down": [], | ||
"just_global": [], | ||
"refs": [ | ||
"req example.req1" | ||
], | ||
"framework": "JSON", | ||
"kind": "Test Vector", | ||
"status": null | ||
}, | ||
{ | ||
"tag": "json ./one/two/basic.json:one.two.basic.2", | ||
"location": { | ||
"kind": "file", | ||
"file": "./one/two/basic.json", | ||
"line": null, | ||
"column": null | ||
}, | ||
"name": "./one/two/basic.json:one.two.basic.2", | ||
"messages": [], | ||
"just_up": [], | ||
"just_down": [], | ||
"just_global": [], | ||
"framework": "JSON", | ||
"kind": "Test Vector", | ||
"status": null | ||
}, | ||
{ | ||
"tag": "json ./one/two/basic.json:one.two.basic.3", | ||
"location": { | ||
"kind": "file", | ||
"file": "./one/two/basic.json", | ||
"line": null, | ||
"column": null | ||
}, | ||
"name": "./one/two/basic.json:one.two.basic.3", | ||
"messages": [], | ||
"just_up": [], | ||
"just_down": [], | ||
"just_global": [], | ||
"refs": [ | ||
"req example.req2", | ||
"req example.req3" | ||
], | ||
"framework": "JSON", | ||
"kind": "Test Vector", | ||
"status": null | ||
}, | ||
{ | ||
"tag": "json ./one/two/basic.json:one.two.basic.4", | ||
"location": { | ||
"kind": "file", | ||
"file": "./one/two/basic.json", | ||
"line": null, | ||
"column": null | ||
}, | ||
"name": "./one/two/basic.json:one.two.basic.4", | ||
"messages": [], | ||
"just_up": [], | ||
"just_down": [], | ||
"just_global": [], | ||
"framework": "JSON", | ||
"kind": "Test Vector", | ||
"status": null | ||
}, | ||
{ | ||
"tag": "json ./one/two/basic.json:one.two.basic.5", | ||
"location": { | ||
"kind": "file", | ||
"file": "./one/two/basic.json", | ||
"line": null, | ||
"column": null | ||
}, | ||
"name": "./one/two/basic.json:one.two.basic.5", | ||
"messages": [], | ||
"just_up": [], | ||
"just_down": [], | ||
"just_global": [], | ||
"refs": [ | ||
"req example.req4" | ||
], | ||
"framework": "JSON", | ||
"kind": "Test Vector", | ||
"status": null | ||
}, | ||
{ | ||
"tag": "json ./one/two/basic.json:one.two.basic.6", | ||
"location": { | ||
"kind": "file", | ||
"file": "./one/two/basic.json", | ||
"line": null, | ||
"column": null | ||
}, | ||
"name": "./one/two/basic.json:one.two.basic.6", | ||
"messages": [], | ||
"just_up": [], | ||
"just_down": [], | ||
"just_global": [], | ||
"framework": "JSON", | ||
"kind": "Test Vector", | ||
"status": null | ||
} | ||
], | ||
"generator": "lobster-json", | ||
"schema": "lobster-act-trace", | ||
"version": 3 | ||
} |
Empty file.
1 change: 1 addition & 0 deletions
1
...tem/lobster-json/rbt-synthetic-tag-name/nested-input-structure/expected-output/stdout.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
lobster-json: wrote 6 items to output.lobster |
3 changes: 3 additions & 0 deletions
3
tests-system/lobster-json/rbt-synthetic-tag-name/nested-input-structure/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--single | ||
--tag-attribute=tags | ||
--out=output.lobster |
38 changes: 38 additions & 0 deletions
38
...ystem/lobster-json/rbt-synthetic-tag-name/nested-input-structure/input/one/two/basic.json
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,38 @@ | ||
[ | ||
{ | ||
"name" : "Test_1", | ||
"tags" : ["example.req1"], | ||
"inputs" : [1, 2], | ||
"expect" : 3 | ||
}, | ||
{ | ||
"name" : "Test_2", | ||
"tags" : [], | ||
"inputs" : [1, 0], | ||
"expect" : 1 | ||
}, | ||
{ | ||
"name" : "Test_3", | ||
"tags" : ["example.req2", | ||
"example.req3"], | ||
"inputs" : [1, 0], | ||
"expect" : 1 | ||
}, | ||
{ | ||
"name" : "Test_4", | ||
"tags" : null, | ||
"inputs" : [1, 0], | ||
"expect" : 1 | ||
}, | ||
{ | ||
"name" : "Test_5", | ||
"tags" : "example.req4", | ||
"inputs" : [1, 0], | ||
"expect" : 1 | ||
}, | ||
{ | ||
"name" : "Test_6", | ||
"inputs" : [1, 0], | ||
"expect" : 1 | ||
} | ||
] |
Oops, something went wrong.