Skip to content

Commit

Permalink
Fix shellcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sgizler committed Sep 25, 2024
1 parent 900c1c4 commit 520fdbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions examples/caliptra_vcd/sv-bugpoint-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ mkfifo sim.vcd
trap cleanup EXIT INT HUP TERM

timeout 3 ./obj_dir/Vcaliptra_top_tb &
# shellcheck disable=SC2016
# extract all changes to timer1_timeout_period[0] and timer1_timeout_period[1] before timestamp "40"
timeout 3 awk '
/var wire .* timer1_timeout_period\[/ { ID_TO_NAME[$4]=$5 }
Expand Down
13 changes: 5 additions & 8 deletions tests/run_test
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
printf "TEST: %s\n" "$1"

actual_file=out/"$1"/sv-bugpoint-minimized.sv
[ -e $actual_file ] && rm $actual_file # to not get fake PASS if bugpoint did not overwrite old result
[ -e "$actual_file" ] && rm "$actual_file" # to not get fake PASS if bugpoint did not overwrite old result
golden_file=golden/"$1"/sv-bugpoint-minimized.sv

bugpoint_msg=$(sv-bugpoint out/"$1" "$2" "$3" --force 2>&1)
if [ $? -ne 0 ]; then
printf "%s\n" "$bugpoint_msg" >&2; exit 1
fi
bugpoint_msg=$(sv-bugpoint out/"$1" "$2" "$3" --force 2>&1) || (printf "%s\n" "$bugpoint_msg" >&2; exit 1)

diff $golden_file $actual_file --color=always >&2
diff "$golden_file" "$actual_file" --color=always >&2

EXIT_CODE=$?

[ "$EXIT_CODE" -eq 0 ] && printf "PASSED\n\n" || printf "FAILED\n\n"
if [ -n "$GOLDEN" ]; then
mkdir -p "$(dirname $golden_file)"
cp $actual_file $golden_file
mkdir -p "$(dirname "$golden_file")"
cp "$actual_file" "$golden_file"
fi

exit $EXIT_CODE

0 comments on commit 520fdbf

Please sign in to comment.