mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Modified buid_examples.sh to handle new locations of examples
This commit is contained in:
parent
382999b378
commit
f7a9a2f50b
@ -15,34 +15,38 @@ FAILED_EXAMPLES=""
|
||||
|
||||
RESULT_WARNINGS=22 # magic number result code for "warnings found"
|
||||
|
||||
for example in ${IDF_PATH}/examples/*; do
|
||||
[ -f ${example}/Makefile ] || continue
|
||||
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
||||
mkdir -p example_builds/${EXAMPLE_NUM}
|
||||
cp -r ${example} example_builds/${EXAMPLE_NUM}
|
||||
pushd example_builds/${EXAMPLE_NUM}/`basename ${example}`
|
||||
# traverse categories
|
||||
for category in ${IDF_PATH}/examples/*; do
|
||||
# traverse examples within each category
|
||||
for example in ${category}/*; do
|
||||
[ -f ${example}/Makefile ] || continue
|
||||
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
||||
mkdir -p example_builds/${EXAMPLE_NUM}
|
||||
cp -r ${example} example_builds/${EXAMPLE_NUM}
|
||||
pushd example_builds/${EXAMPLE_NUM}/`basename ${example}`
|
||||
|
||||
# be stricter in the CI build than the default IDF settings
|
||||
export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
||||
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||
# be stricter in the CI build than the default IDF settings
|
||||
export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
||||
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||
|
||||
# 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=$?; FAILED_EXAMPLES+=" ${example}"; make V=1; } # only build verbose if there's an error
|
||||
popd
|
||||
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
||||
# 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=$?; FAILED_EXAMPLES+=" ${example}"; make V=1; } # only build verbose if there's an error
|
||||
popd
|
||||
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
||||
|
||||
if grep -q ": warning:" $BUILDLOG; then
|
||||
[ $RESULT -eq 0 ] && RESULT=$RESULT_WARNINGS
|
||||
FAILED_EXAMPLES+=" ${example} (warnings)"
|
||||
fi
|
||||
if grep -q ": warning:" $BUILDLOG; then
|
||||
[ $RESULT -eq 0 ] && RESULT=$RESULT_WARNINGS
|
||||
FAILED_EXAMPLES+=" ${example} (warnings)"
|
||||
fi
|
||||
|
||||
rm -f $BUILDLOG
|
||||
rm -f $BUILDLOG
|
||||
done
|
||||
done
|
||||
|
||||
if [ $RESULT -eq $RESULT_WARNINGS ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user