Przeglądaj źródła

Try to fix TravisCI issues

The same build works localy but fails on Travis. Try to change something Travis related, and see what happens.
bel2125 4 lat temu
rodzic
commit
ba06e8a1ae
4 zmienionych plików z 55 dodań i 12 usunięć
  1. 25 0
      .travis.yml
  2. 8 7
      src/civetweb.c
  3. 19 1
      src/main.c
  4. 3 4
      unittest/civetweb_check.h

+ 25 - 0
.travis.yml

@@ -67,6 +67,31 @@ before_script:
   - cmake --version
   - gcc unittest/cgi_test.c -o output/cgi_test.cgi
   - cd output
+  - echo cmake
+    -G "Unix Makefiles"
+    -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
+    -DBUILD_SHARED_LIBS=${BUILD_SHARED}
+    "-DCIVETWEB_THIRD_PARTY_DIR=${HOME}/third-party"
+    -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
+    -DCIVETWEB_ENABLE_SSL=${ENABLE_SSL}
+    -DCIVETWEB_DISABLE_CGI=${NO_CGI}
+    -DCIVETWEB_SERVE_NO_FILES=${NO_FILES}
+    -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=${ENABLE_SSL_DYNAMIC_LOADING}
+    -DCIVETWEB_SSL_OPENSSL_API_1_0=${OPENSSL_1_0}
+    -DCIVETWEB_SSL_OPENSSL_API_1_1=${OPENSSL_1_1}
+    -DCIVETWEB_ENABLE_WEBSOCKETS=${ENABLE_WEBSOCKETS}
+    -DCIVETWEB_ENABLE_CXX=${ENABLE_CXX}
+    -DCIVETWEB_ENABLE_SERVER_STATS=${ENABLE_SERVER_STATS}
+    -DCIVETWEB_ENABLE_LUA=${ENABLE_LUA}
+    -DCIVETWEB_ENABLE_LUA_SHARED=${ENABLE_LUA_SHARED}
+    -DCIVETWEB_ENABLE_DUKTAPE=${ENABLE_DUKTAPE}
+    -DCIVETWEB_DISABLE_CACHING=${NO_CACHING}
+    -DCIVETWEB_C_STANDARD=${C_STANDARD}
+    -DCIVETWEB_CXX_STANDARD=${CXX_STANDARD}
+    -DCIVETWEB_ALLOW_WARNINGS=${ALLOW_WARNINGS}
+    -DCIVETWEB_ENABLE_IPV6=${ENABLE_IPV6}
+    ${ADDITIONAL_CMAKE_ARGS}
+    ..
   - cmake
     -G "Unix Makefiles"
     -DCMAKE_BUILD_TYPE=${BUILD_TYPE}

+ 8 - 7
src/civetweb.c

@@ -20535,13 +20535,14 @@ mg_get_system_info(char *buffer, int buflen)
 #pragma GCC diagnostic ignored "-Wdate-time"
 #endif
 #endif
-		mg_snprintf(NULL,
-		            NULL,
-		            block,
-		            sizeof(block),
-		            ",%s\"build\" : \"%s\"",
-		            eol,
-		            __DATE__);
+#ifdef BUILD_DATE
+		const char *bd = BUILD_DATE;
+#else
+		const char *bd = __DATE__;
+#endif
+
+		mg_snprintf(
+		    NULL, NULL, block, sizeof(block), ",%s\"build\" : \"%s\"", eol, bd);
 
 #if defined(GCC_DIAGNOSTIC)
 #if GCC_VERSION >= 40900

+ 19 - 1
src/main.c

@@ -34,6 +34,14 @@
 
 #else
 
+#if defined(__clang__) /* GCC does not (yet) support this pragma */
+/* We must set some flags for the headers we include. These flags
+ * are reserved ids according to C99, so we need to disable a
+ * warning for that. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wreserved-id-macro"
+#endif
+
 #define _XOPEN_SOURCE 600 /* For PATH_MAX on linux */
 /* This should also be sufficient for "realpath", according to
  * http://man7.org/linux/man-pages/man3/realpath.3.html, but in
@@ -72,6 +80,11 @@
 #define __STDC_LIMIT_MACROS /* C++ wants that for INT64_MAX */
 #endif
 
+#if defined(__clang__)
+/* Enable reserved-id-macro warning again. */
+#pragma GCC diagnostic pop
+#endif
+
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>
@@ -263,11 +276,16 @@ static int MakeConsole(void);
 static void
 show_server_name(void)
 {
+#ifdef BUILD_DATE
+	const char *bd = BUILD_DATE;
+#else
+	const char *bd = __DATE__;
+#endif
 #if defined(WIN32)
 	(void)MakeConsole();
 #endif
 
-	fprintf(stderr, "CivetWeb v%s, built on %s\n", mg_version(), __DATE__);
+	fprintf(stderr, "CivetWeb v%s, built on %s\n", mg_version(), bd);
 }
 
 

+ 3 - 4
unittest/civetweb_check.h

@@ -84,13 +84,12 @@
 #endif
 
 /* A minimal timeout used for all tests with the "check" framework. */
-#define civetweb_min_test_timeout (30)
+#define civetweb_min_test_timeout (60)
 
 /* A minimal timeout for all tests starting a server. */
-#define civetweb_min_server_test_timeout (civetweb_min_test_timeout + 30)
+#define civetweb_min_server_test_timeout (90)
 
 /* A default timeout for all tests running multiple requests to a server. */
-#define civetweb_mid_server_test_timeout                                       \
-	(civetweb_min_server_test_timeout + 180)
+#define civetweb_mid_server_test_timeout (240)
 
 #endif /* TEST_CIVETWEB_CHECK_H_ */