Merge branch 'bugfix/ci_build_example_failures' into 'master'

Fix CI build example not failing on errors



See merge request !357
This commit is contained in:
Ivan Grokhotkov 2017-01-05 00:48:27 +08:00
commit 6f578796d3
4 changed files with 17 additions and 14 deletions

View File

@ -30,6 +30,7 @@
#include "bt_trace.h" #include "bt_trace.h"
#include "bt_types.h" #include "bt_types.h"
#include "bta_api.h"
#include "blufi.h" #include "blufi.h"

View File

@ -46,15 +46,15 @@ const int CONNECTED_BIT = BIT0;
static wifi_config_t sta_config; static wifi_config_t sta_config;
static char tmp_ssid[33]; static char tmp_ssid[33];
static char tmp_passwd[33]; static char tmp_passwd[65];
static bool confirm = false; static bool confirm = false;
void wifi_set_blue_config(char *ssid, char *passwd) void wifi_set_blue_config(char *ssid, char *passwd)
{ {
memset(tmp_ssid, 0, 33); memset(tmp_ssid, 0, sizeof(tmp_ssid));
memset(tmp_passwd, 0, 33); memset(tmp_passwd, 0, sizeof(tmp_passwd));
strcpy(tmp_ssid, ssid); strlcpy(tmp_ssid, ssid, sizeof(tmp_ssid));
strcpy(tmp_passwd, passwd); strlcpy(tmp_passwd, passwd, sizeof(tmp_passwd));
confirm = true; confirm = true;
LOG_DEBUG("confirm true\n"); LOG_DEBUG("confirm true\n");
} }
@ -105,8 +105,8 @@ void wifiTestTask(void *pvParameters)
if (confirm) { if (confirm) {
confirm = false; confirm = false;
strcpy(sta_config.sta.ssid, tmp_ssid); memcpy(sta_config.sta.ssid, tmp_ssid, sizeof(sta_config.sta.ssid));
strcpy(sta_config.sta.password, tmp_passwd); memcpy(sta_config.sta.password, tmp_passwd, sizeof(sta_config.sta.password));
sta_config.sta.bssid_set = 0; sta_config.sta.bssid_set = 0;
ret = esp_wifi_disconnect(); ret = esp_wifi_disconnect();

View File

@ -11,11 +11,10 @@
EXAMPLE_NUM=1 EXAMPLE_NUM=1
RESULT=0 RESULT=0
FAILED_EXAMPLES=""
RESULT_WARNINGS=22 # magic number result code for "warnings found" RESULT_WARNINGS=22 # magic number result code for "warnings found"
set -e
for example in ${IDF_PATH}/examples/*; do for example in ${IDF_PATH}/examples/*; do
[ -f ${example}/Makefile ] || continue [ -f ${example}/Makefile ] || continue
echo "Building ${example} as ${EXAMPLE_NUM}..." echo "Building ${example} as ${EXAMPLE_NUM}..."
@ -30,16 +29,17 @@ for example in ${IDF_PATH}/examples/*; do
# build non-verbose first # build non-verbose first
BUILDLOG=$(mktemp -t examplebuild.XXXX.log) BUILDLOG=$(mktemp -t examplebuild.XXXX.log)
( (
set -o pipefail # so result of make all isn't lost when piping to tee
set -e set -e
make clean defconfig make clean defconfig
make all 2>&1 | tee $BUILDLOG make $* all 2>&1 | tee $BUILDLOG
) || (RESULT=$?; make V=1) # only build verbose if there's an error ) || { RESULT=$?; FAILED_EXAMPLES+=" ${example}"; make V=1; } # only build verbose if there's an error
popd popd
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 )) EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
if [ $RESULT -eq 0 ] && grep -q ": warning:" $BUILDLOG; then if grep -q ": warning:" $BUILDLOG; then
echo "Build will fail, due to warnings in this example" [ $RESULT -eq 0 ] && RESULT=$RESULT_WARNINGS
RESULT=$RESULT_WARNINGS FAILED_EXAMPLES+=" ${example} (warnings)"
fi fi
rm -f $BUILDLOG rm -f $BUILDLOG
@ -49,5 +49,7 @@ if [ $RESULT -eq $RESULT_WARNINGS ]; then
echo "Build would have passed, except for warnings." echo "Build would have passed, except for warnings."
fi fi
[ $RESULT -eq 0 ] || echo "Failed examples: $FAILED_EXAMPLES"
exit $RESULT exit $RESULT