You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/25 07:19:55 UTC

[GitHub] [incubator-nuttx] liuguo09 commented on issue #1114: testbuild.sh: Fails if EXTRA_FLAGS not defined

liuguo09 commented on issue #1114:
URL: https://github.com/apache/incubator-nuttx/issues/1114#issuecomment-633420153


   If call testbuild.sh with the change you made, it works well with  _-e "-Wno-cpp"_ is OK, but it doesn't work with  _-e "-Wno-cpp -Werror"_ , fail log as below. 
   
   _+ make --silent --no-print-directory 'EXTRAFLAGS="-Wno-cpp' '-Werror"' -j 4
    /bin/sh: 1: Syntax error: Unterminated quoted string_
   
   We may need find another way to fix both qeuestions.
   
   > Perhaps something like this would do the job:
   > 
   > ```
   > diff --git a/tools/testbuild.sh b/tools/testbuild.sh
   > index 91efb5354e..6895ef181e 100755
   > --- a/tools/testbuild.sh
   > +++ b/tools/testbuild.sh
   > @@ -89,7 +89,7 @@ while [ ! -z "$1" ]; do
   >      ;;
   >    -e )
   >      shift
   > -    EXTRA_FLAGS="EXTRAFLAGS=$1"
   > +    EXTRA_FLAGS="EXTRAFLAGS=\"$1\""
   >      ;;
   >    -x )
   >      MAKE_FLAGS='--silent --no-print-directory'
   > @@ -158,7 +158,7 @@ blacklist=`grep "^-" $testfile || true`
   >  cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
   > 
   >  function makefunc {
   > -  if ! ${MAKE} ${MAKE_FLAGS} "${EXTRA_FLAGS}" $@ 1>/dev/null; then
   > +  if ! ${MAKE} ${MAKE_FLAGS} ${EXTRA_FLAGS} $@ 1>/dev/null; then
   >      fail=1
   >    fi
   >  }
   > ```
   > 
   > The backslash will retain the " inside of the EXTRA_FLAGS string and it should be present on the command line when ${EXTRA_FLAGS} is expanded. If EXTRA_FLAGS is not defined then nothing will be put on the command line.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org