[glib: 1/2] msvc: build the glib tests and ignore the test outcome



commit 79af48791a15a65ee5c1cdaf354df8cd5651fd90
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sat May 26 17:59:27 2018 +0200

    msvc: build the glib tests and ignore the test outcome
    
    This makes the tests build under VS2015/2017.
    Since some of them fail, similar to the mingw build, ignore any test errors for now.

 .gitlab-ci/test-msvc.bat |  3 ++-
 glib/meson.build         |  5 +----
 glib/tests/date.c        |  4 ++++
 glib/tests/fileutils.c   | 10 +++++++++-
 4 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat
index 69759837f..a62882de0 100644
--- a/.gitlab-ci/test-msvc.bat
+++ b/.gitlab-ci/test-msvc.bat
@@ -8,7 +8,8 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary
 meson _build || goto :error
 ninja -C _build || goto :error
 
-meson test -C _build --timeout-multiplier %MESON_TEST_TIMEOUT_MULTIPLIER% || goto :error
+:: FIXME: dont ignore test errors
+meson test -C _build --timeout-multiplier %MESON_TEST_TIMEOUT_MULTIPLIER%
 
 :: FIXME: can we get code coverage support?
 
diff --git a/glib/meson.build b/glib/meson.build
index 1010f5d92..036d1f4d6 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -327,7 +327,4 @@ if enable_systemtap
     install : true)
 endif
 
-# gtester doesn't work on native windows
-if cc.get_id() != 'msvc'
-  subdir('tests')
-endif
+subdir('tests')
diff --git a/glib/tests/date.c b/glib/tests/date.c
index e2e1f7fb9..84c486903 100644
--- a/glib/tests/date.c
+++ b/glib/tests/date.c
@@ -17,6 +17,10 @@
 #ifdef G_OS_WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
+/* mingw defines it while msvc doesn't */
+#ifndef SUBLANG_LITHUANIAN_LITHUANIA
+#define SUBLANG_LITHUANIAN_LITHUANIA 0x01
+#endif
 #endif
 
 static void
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index c08249650..0e67cd153 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -36,11 +36,19 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <utime.h>
 #endif
 #include <fcntl.h>
-#include <utime.h>
 #ifdef G_OS_WIN32
 #include <windows.h>
+#include <sys/utime.h>
+#include <io.h>
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+#endif
+#ifndef F_OK
+#define F_OK 0
+#endif
 #endif
 
 #define S G_DIR_SEPARATOR_S


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]