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_types.h"
#include "bta_api.h"
#include "blufi.h"

View file

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

View file

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