-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add to quint workflow a step to generate traces, including Script/tra…
…ce-remove-stuttering-steps.sh
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
FILE=$1 | ||
[[ ! -f "$FILE" ]] && echo "Error: $FILE does not exist" && exit 1 | ||
|
||
# The following jq command removes all stuttering steps on an ITF trace file. A stuttering step | ||
# happens in a trace when a state is followed by the same state. | ||
# | ||
# Note that for comparing states we remove from all states the "#meta" field, which is different for | ||
# each state as it includes a sequential index number. This information is not needed for displaying | ||
# or doing MBT on the trace. | ||
# | ||
# TODO: For completeness, include the state #meta field in the resulting trace file. | ||
echo $(cat $1 | jq -c '{"#meta":."#meta", vars:.vars, states: (.states | del(.[]."#meta") | reduce .[] as $a ([]; if IN(.[]; $a) then . else . += [$a] end))}') > $1 |