We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 984a867 commit f7aa692Copy full SHA for f7aa692
tools/check_code_size.sh
@@ -0,0 +1,23 @@
1
+#!/bin/bash
2
+#
3
+# This script check that changes don't lead to code size regressions.
4
+# (Size of the language core (== minimal port should not grow)).
5
6
+
7
+REFERENCE=$HOME/persist/firmware.bin
8
+#REFERENCE=/tmp/micropython
9
+#TRAVIS_PULL_REQUEST=false
10
11
+if [ -f $REFERENCE ]; then
12
+ size_old=$(stat -c%s $REFERENCE)
13
+ size_new=$(stat -c%s minimal/build/firmware.bin)
14
+ echo "Old size: $size_old new size: $size_new"
15
+ if [ $size_new -gt $size_old ]; then
16
+ echo "Validation failure: Core code size increased"
17
+ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
18
+ exit 1
19
+ fi
20
21
+else
22
+ echo "Warning: reference file doesn't exist, code size check didn't run"
23
+fi
0 commit comments