DESC="Check if -iquote option is only passed once to g++ when compiling multiple files"

runtest()
{

  EXEC="${AGCC} -p ${TestSrcDir} -v2 -o test ${TestSrcDir}/*.cc"
  if  ( ${EXEC} );then true;else
    ERR_MSG="Execution failed: '${EXEC}'"
    return 1
  fi

  OPT_COUNTER=$(grep 'Options (G++):' ${StdOutFile}|grep -o "\-iquote \"${TestSrcDir}\""|wc -l)
  if [ ${OPT_COUNTER} -ne 1 ]; then
    ERR_MSG="The option '-iquote ${TestSrcDir}' has been passed more than once to g++ (${OPT_COUNTER} times) "
    return 1
  fi

  return 0
}
