check_errors.sh (1022B)
1 #!/bin/sh 2 3 # 4 # Trompeloeil C++ mocking framework 5 # 6 # Copyright Björn Fahller 2014-2021 7 # 8 # Use, modification and distribution is subject to the 9 # Boost Software License, Version 1.0. (See accompanying 10 # file LICENSE_1_0.txt or copy at 11 # http://www.boost.org/LICENSE_1_0.txt) 12 # 13 # Project home: https://github.com/rollbear/trompeloeil 14 # 15 PASS="\033[32mPASS\033[0m" 16 FAIL="\033[1;31mFAIL\033[0m" 17 FAILURES=0 18 19 echo "CXX=$CXX" 20 echo "CXXFLAGS=$CXXFLAGS" 21 echo "CPPFLAGS=$CPPFLAGS" 22 23 # Default CXXFLAGS to -std=c++14 if not set in the environment 24 # for backward compatibility. 25 #CXXFLAGS=${CXXFLAGS:-"-std=c++14"} 26 27 #echo "CXXFLAGS is now $CXXFLAGS" 28 29 #${CXX} --version 30 cd compilation_errors 31 SCRIPT=' 32 s:^//\(.*\)$:\1:g 33 t print 34 b 35 :print 36 P 37 ' 38 for f in *.cpp 39 do 40 RE=`sed -n "$SCRIPT" < $f` 41 printf "%-45s" $f 42 # echo "RE=$RE" 43 ${CXX} ${CXXFLAGS} ${CPPFLAGS} -I ../include $f -c 2>&1 | egrep -q "${RE}" && echo ${PASS} && continue || echo ${FAIL} && false 44 FAILURES=$((FAILURES+$?)) 45 done 46 # echo "FAILURES=$FAILURES" 47 exit $FAILURES