Skip to content

Commit

Permalink
test/check-size: show error if make fails
Browse files Browse the repository at this point in the history
This patch adds an error message when compilation fails when running the
check-size script.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Jun 8, 2023
1 parent fd809b8 commit 035d8f1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/check-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# across commits. Meant to be used in CI with
# git rebase <base branch>^ -x check-size.sh

# Fail fast on errors
set -e

BIN_NAME=checkpointctl
PREV_SIZE_FILE=prev_size
# Maximum allowable size difference, in bytes
Expand All @@ -16,7 +13,15 @@ MAX_DIFF=51200
# Build the checkpointctl binary. If the commit is not self-contained,
# the build will fail, in which case there is no point checking for a
# change in the size of the binary.
make
if ! make; then
echo "ERROR: Compilation failed at $(git rev-parse --short HEAD)"
echo "Make sure that the compilation is successful for each commit."
exit 1
fi

# Fail fast on errors
set -e

# Store the binary size
BIN_SIZE=$(stat -c%s "$BIN_NAME")
# Print the size along with the commit hash
Expand Down

0 comments on commit 035d8f1

Please sign in to comment.