1#!/bin/bash 2 3RETVAL=0 4 5cd contrib/ports/unix/check 6 7#build and run unit tests 8make clean all 9 10# Build test using make, this tests the Makefile toolchain 11make check -j 4 12ERR=$? 13echo Return value from unittests: $ERR 14if [ $ERR != 0 ]; then 15 echo "++++++++++++++++++++++++++++++ unittests build failed" 16 RETVAL=1 17fi 18 19# Build example_app using cmake, this tests the CMake toolchain 20cd ../../../../ 21# Copy lwipcfg for example app 22cp contrib/examples/example_app/lwipcfg.h.travis contrib/examples/example_app/lwipcfg.h 23 24# Generate CMake 25mkdir build 26cd build 27/usr/local/bin/cmake .. -G Ninja 28ERR=$? 29echo Return value from cmake generate: $ERR 30if [ $ERR != 0 ]; then 31 echo "++++++++++++++++++++++++++++++ cmake GENERATE failed" 32 RETVAL=1 33fi 34 35# Build CMake 36/usr/local/bin/cmake --build . 37ERR=$? 38echo Return value from build: $ERR 39if [ $ERR != 0 ]; then 40 echo "++++++++++++++++++++++++++++++ cmake build failed" 41 RETVAL=1 42fi 43 44# Build docs 45/usr/local/bin/cmake --build . --target lwipdocs 46ERR=$? 47echo Return value from lwipdocs: $ERR 48if [ $ERR != 0 ]; then 49 echo "++++++++++++++++++++++++++++++ lwIP documentation failed" 50 RETVAL=1 51fi 52 53# Test different lwipopts.h 54cd .. 55cd contrib/ports/unix/example_app 56./iteropts.sh 57ERR=$? 58echo Return value from iteropts: $ERR 59if [ $ERR != 0 ]; then 60 echo "++++++++++++++++++++++++++++++ lwIP iteropts test failed" 61 RETVAL=1 62fi 63 64echo Exit value: $RETVAL 65exit $RETVAL 66