Hi,
Issues with the solver and jq noted. Please let me know if you can duplicate or if I’ve done something wrong. Thanks.
Not being a wizard with jq, but only following the webpage examples at Reading the solver’s output — Syside I get the following output for CMD, PS, and Bash shells. I ran all three because there have been inconsistencies between them for the solver command line previously.
The results are:
+====================+
| With Windows 10 PS |
+====================+
> $PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 6 6
PS> syside solver check -i package_pump.sysml
{
"result": {
"subject": "Pump",
"expression": "assertions[2]",
"determination": "determined",
"outcome": {
"shape": "assertions",
"assertions": [
{ "name": "Pump::flowOk", "status": "satisfied", "counterexample": null },
{
"name": "Pump::pressureOk",
"status": "violated",
"counterexample": {
"values": [
["Pump::pump::pressure", "11"]
]
}
}
]
},
"causes": []
},
"warnings": [],
"exit_code": 1
}
+=================================+
| Using native PS commands and jq |
+=================================+
PS> syside solver check -i package_pump.sysml | ConvertFrom-Json |
>> ForEach-Object { $_.result.outcome.assertions } |
>> Format-Table name, status
ConvertFrom-Json: Conversion from JSON failed with error: Unexpected character encountered while parsing value: ?. Path '', line 1, position 1.
+==============+
| and using jq |
+==============+
PS> jq --version
jq-1.8.2
PS> syside solver check -i package_Pump.sysml | jq -r '.result.outcome.assertions[] | "\(.status)\t\(.name)"'
jq: parse error: Invalid numeric literal at line 1, column 3
+==============================+
| With Windows 10 CMD using jq |
+==============================+
CMD> syside solver check -i package_Pump.sysml | jq -r '.result.outcome.assertions[] | "\(.status)\t\(.name)"'
The system cannot find the path specified.
+===============+
| With Git bash |
+===============+
$ echo $BASH_VERSION
5.2.37(1)-release
$ syside solver check -i package_Pump.sysml | jq -r '.result.outcome.assertions[] | "\(.status)\t\(.name)"'
jq: parse error: Invalid numeric literal at line 1, column 3
V/r,
