File tree Expand file tree Collapse file tree 2 files changed +51
-8
lines changed Expand file tree Collapse file tree 2 files changed +51
-8
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,12 @@ addons:
13
13
script :
14
14
- set -e
15
15
- export CXX="g++-4.8" CC="gcc-4.8" GCOV="gcov-4.8"
16
+ - echo -e "travis_fold:start:host_tests"
16
17
- pushd $TRAVIS_BUILD_DIR/tests/host
17
18
- make
18
19
- make clean-objects
20
+ - echo -e "travis_fold:end:host_tests"
21
+ - echo -e "travis_fold:start:sketch_test_env_prepare"
19
22
- popd
20
23
- wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
21
24
- tar xf arduino.tar.xz
@@ -26,15 +29,18 @@ script:
26
29
- ln -s $TRAVIS_BUILD_DIR esp8266
27
30
- cd esp8266/tools
28
31
- python get.py
29
- - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
30
- - sleep 3
31
- - export DISPLAY=:1.0
32
- - export PATH="$HOME/arduino_ide:$PATH"
32
+ - export PATH="$HOME/arduino_ide:$TRAVIS_BUILD_DIR/tools/xtensa-lx106-elf/bin:$PATH"
33
33
- which arduino
34
34
- cd $TRAVIS_BUILD_DIR
35
35
- source tests/common.sh
36
36
- install_libraries
37
- - build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR "python tools/build.py -l $HOME/Arduino/libraries -b generic -v"
37
+ - echo -e "travis_fold:end:sketch_test_env_prepare"
38
+ - echo -e "travis_fold:start:sketch_test"
39
+ - build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR "-l $HOME/Arduino/libraries"
40
+ - echo -e "travis_fold:end:sketch_test"
41
+ - echo -e "travis_fold:start:size_report"
42
+ - cat size.log
43
+ - echo -e "travis_fold:end:size_report"
38
44
39
45
after_success :
40
46
- pushd $TRAVIS_BUILD_DIR/tests/host
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /usr/bin/env bash
2
+
3
+ function print_size_info()
4
+ {
5
+ elf_file=$1
6
+
7
+ if [ -z " $elf_file " ]; then
8
+ printf " sketch data rodata bss text irom0.text dram flash\n"
9
+ return 0
10
+ fi
11
+
12
+ elf_name=$( basename $elf_file )
13
+ sketch_name=" ${elf_name% .* } "
14
+ # echo $sketch_name
15
+ declare -A segments
16
+ while read -a tokens; do
17
+ seg=${tokens[0]}
18
+ seg=${seg// ./ }
19
+ size=${tokens[1]}
20
+ addr=${tokens[2]}
21
+ if [ " $addr " -eq " $addr " -a " $addr " -ne " 0" ] 2> /dev/null; then
22
+ segments[$seg ]=$size
23
+ fi
24
+
25
+
26
+ done < <( xtensa-lx106-elf-size --format=sysv $elf_file )
27
+
28
+ total_ram=$(( ${segments[data]} + ${segments[rodata]} + ${segments[bss]} ))
29
+ total_flash=$(( ${segments[data]} + ${segments[rodata]} + ${segments[text]} + ${segments[irom0text]} ))
30
+
31
+ printf " %-28s %-8d %-8d %-8d %-8d %-8d %-8d %-8d\n" $sketch_name ${segments[data]} ${segments[rodata]} ${segments[bss]} ${segments[text]} ${segments[irom0text]} $total_ram $total_flash
32
+ return 0
33
+ }
2
34
3
35
function build_sketches()
4
36
{
5
37
set +e
6
38
local arduino=$1
7
39
local srcpath=$2
8
- local build_cmd=$3
9
- echo $build_cmd
40
+ local build_arg=$3
41
+ local build_dir=build.tmp
42
+ mkdir -p $build_dir
43
+ rm -rf $build_dir /*
44
+ local build_cmd=" python tools/build.py -b generic -v -k -p $PWD /$build_dir $build_arg "
10
45
local sketches=$( find $srcpath -name * .ino)
46
+ print_size_info > size.log
11
47
export ARDUINO_IDE_PATH=$arduino
12
48
for sketch in $sketches ; do
13
49
local sketchdir=$( dirname $sketch )
@@ -33,6 +69,7 @@ function build_sketches()
33
69
return $result
34
70
fi
35
71
rm build.log
72
+ print_size_info $build_dir /* .elf >> size.log
36
73
done
37
74
set -e
38
75
}
You can’t perform that action at this time.
0 commit comments