forked from espressif/arduino-esp32
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtests_build.sh
executable file
·64 lines (54 loc) · 1.15 KB
/
tests_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
USAGE="
USAGE:
${0} -c <chunk_build_opts>
Example: ${0} -c -t esp32 -i 0 -m 15
${0} -s sketch_name <build_opts>
Example: ${0} -s hello_world -t esp32
${0} -clean
Remove build and test generated files
"
function clean(){
rm -rf tests/*/build*/
rm -rf tests/.pytest_cache
rm -rf tests/*/__pycache__/
rm -rf tests/*/*.xml
}
SCRIPTS_DIR="./.github/scripts"
BUILD_CMD=""
chunk_build=0
while [ ! -z "$1" ]; do
case $1 in
-c )
chunk_build=1
;;
-s )
shift
sketch=$1
;;
-h )
echo "$USAGE"
exit 0
;;
-clean )
clean
exit 0
;;
* )
break
;;
esac
shift
done
#source ${SCRIPTS_DIR}/install-arduino-ide.sh
source ${SCRIPTS_DIR}/install-arduino-cli.sh
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
args="-ai $ARDUINO_IDE_PATH -au $ARDUINO_USR_PATH"
if [ $chunk_build -eq 1 ]; then
BUILD_CMD="${SCRIPTS_DIR}/sketch_utils.sh chunk_build"
args+=" -p $PWD/tests"
else
BUILD_CMD="${SCRIPTS_DIR}/sketch_utils.sh build"
args+=" -s $PWD/tests/$sketch"
fi
${BUILD_CMD} ${args} $*