Explorar el Código

BuildBot console report code

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15126 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind hace 13 años
padre
commit
7fcfb73534
Se han modificado 4 ficheros con 21 adiciones y 0 borrados
  1. 3 0
      src/common/core.c
  2. 4 0
      src/common/core.h
  3. 10 0
      src/common/showmsg.c
  4. 4 0
      src/map/map.c

+ 3 - 0
src/common/core.c

@@ -28,6 +28,9 @@
 /// Called when a terminate signal is received.
 void (*shutdown_callback)(void) = NULL;
 
+#if defined(BUILDBOT)
+	bool buildbotflag;
+#endif
 
 int runflag = CORE_ST_RUN;
 int arg_c = 0;

+ 4 - 0
src/common/core.h

@@ -7,6 +7,10 @@
 extern int arg_c;
 extern char **arg_v;
 
+#if defined(BUILDBOT)
+extern bool buildbotflag;
+#endif
+
 /// @see E_CORE_ST
 extern int runflag;
 extern char *SERVER_NAME;

+ 10 - 0
src/common/showmsg.c

@@ -687,6 +687,16 @@ int _vShowMessage(enum msg_type flag, const char *string, va_list ap)
 		ShowError("Empty string passed to _vShowMessage().\n");
 		return 1;
 	}
+	/**
+	 * For the buildbot, these result in a EXIT_FAILURE from core.c when done reading the params.
+	 **/
+#if defined(BUILDBOT)
+	if( flag == MSG_WARNING ||
+	    flag == MSG_ERROR ||
+	    flag == MSG_SQL ) {
+		bool buildbotflag = true;
+	}
+#endif
 	if(
 		( flag == MSG_WARNING && console_msg_log&1 ) ||
 		( ( flag == MSG_ERROR || flag == MSG_SQL ) && console_msg_log&2 ) ||

+ 4 - 0
src/map/map.c

@@ -3788,6 +3788,10 @@ int do_init(int argc, char *argv[])
 		shutdown_callback = do_shutdown;
 		runflag = MAPSERVER_ST_RUNNING;
 	}
+#if defined(BUILDBOT)
+	if( buildbotflag )
+		exit(EXIT_FAILURE);
+#endif
 
 	return 0;
 }