This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,26 @@ echo '==========='
7
7
echo ' == BUILD =='
8
8
echo ' ==========='
9
9
10
- SIZE_TOO_BIG_COUNT =0
10
+ SIZE_UNEXPECTED_COUNT =0
11
11
12
12
export SAUCE_ACCESS_KEY=` echo $SAUCE_ACCESS_KEY | rev`
13
13
14
14
function checkSize() {
15
15
file=$1
16
16
if [[ ! -e $file ]]; then
17
17
echo Could not find file: $file
18
- SIZE_TOO_BIG_COUNT =$(( SIZE_TOO_BIG_COUNT + 1 )) ;
18
+ SIZE_UNEXPECTED_COUNT =$(( SIZE_UNEXPECTED_COUNT + 1 )) ;
19
19
else
20
20
expected=$2
21
21
actual=` cat $file | gzip | wc -c`
22
22
if (( 100 * $actual >= 105 * $expected )) ; then
23
23
echo ${file} is too large expecting ${expected} was ${actual} .
24
- SIZE_TOO_BIG_COUNT=$(( SIZE_TOO_BIG_COUNT + 1 )) ;
24
+ SIZE_UNEXPECTED_COUNT=$(( SIZE_UNEXPECTED_COUNT + 1 )) ;
25
+ fi
26
+ if (( 100 * $actual <= 95 * $expected )) ; then
27
+ echo ${file} is too small expecting ${expected} was ${actual} .
28
+ echo Please update scripts/travis/build.sh with the correct value.
29
+ SIZE_UNEXPECTED_COUNT=$(( SIZE_UNEXPECTED_COUNT + 1 )) ;
25
30
fi
26
31
fi
27
32
}
@@ -59,7 +64,7 @@ if [[ $TESTS == "dart2js" ]]; then
59
64
checkSize build/web/bouncing_balls.dart.js 202325
60
65
checkSize build/web/hello_world.dart.js 210000
61
66
checkSize build/web/todo.dart.js 203121
62
- if (( SIZE_TOO_BIG_COUNT > 0 )) ; then
67
+ if (( SIZE_UNEXPECTED_COUNT > 0 )) ; then
63
68
exit 1
64
69
else
65
70
echo Generated JavaScript file size check OK.
You can’t perform that action at this time.
0 commit comments