DESC="Generate Object File from source file and link it afterwards"

runtest()
{
  mkdir -p bin obj

  OBJ="obj/Test03.o"
  BIN="bin/test03${EXT}"

  EXEC="${AGCC} -v2 --path \"${TestSrcDir}\" -c -o ${OBJ} \"${TestSrcDir}/Test.cc\""
  if  (${EXEC});then true;else
    ERR_MSG="Failed executing '${EXEC}'"
    return 1
  fi

  if [ ! -f ${OBJ} ];then
    ERR_MSG="Object file '${OBJ}' was not created"
    return 1
  fi


  EXEC="${AGCC} -v2 --path ${TestSrcDir} -o ${BIN} ${OBJ} ${TestSrcDir}/main.cc"
  if  (${EXEC});then true;else
    ERR_MSG="Failed executing '${EXEC}"
  fi

  if [ ! -e ${BIN} ];then
    ERR_MSG="Executable '${BIN}' was not created"
    return 1
  fi
}

