#!/bin/bash # # This script check that changes don't lead to code size regressions. # (Size of the language core (== minimal port should not grow)). # setglobal REFERENCE = "$HOME/persist/firmware.bin" #REFERENCE=/tmp/micropython #TRAVIS_PULL_REQUEST=false if test -f $REFERENCE { setglobal size_old = $[stat -c%s $REFERENCE] setglobal size_new = $[stat -c%s minimal/build/firmware.bin] echo "Old size: $size_old new size: $size_new" if test $size_new -gt $size_old { echo "Validation failure: Core code size increased" if test $TRAVIS_PULL_REQUEST != "false" { exit 1 } } } else { echo "Warning: reference file doesn't exist, code size check didn't run" }