summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorfwg <fwg@users.noreply.github.com>2018-04-02 13:55:31 +0200
committerAnthony Green <green@moxielogic.com>2018-04-02 06:55:31 -0500
commitaf6773d6ab4db0577bc6b932ab5a2f98a0a8dca2 (patch)
tree812b6d0727d5104317df93387c2ac341aaf60b9e /testsuite
parent48bdb02867edb7e9f3785ccb4bdff1087fb44246 (diff)
downloadlibffi-af6773d6ab4db0577bc6b932ab5a2f98a0a8dca2.tar.gz
Fix appveyor windows build (#420)
* Fix msvcc dll build by adding dllexport decorations to all API declarations * Fix appveyor build for VS 2013 Use the new -DFFI_BUILDING_DLL for producing a working DLL. Update the msvcc.sh wrapper script to successfully compile the testsuite files. * MSVC build: suppress warnings in testsuite * fix testsuite on appveyor
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/libffi.bhaible/bhaible.exp10
-rw-r--r--testsuite/libffi.bhaible/test-call.c7
-rw-r--r--testsuite/libffi.bhaible/test-callback.c7
-rw-r--r--testsuite/libffi.call/call.exp15
4 files changed, 31 insertions, 8 deletions
diff --git a/testsuite/libffi.bhaible/bhaible.exp b/testsuite/libffi.bhaible/bhaible.exp
index 7f615e6..6a0bb45 100644
--- a/testsuite/libffi.bhaible/bhaible.exp
+++ b/testsuite/libffi.bhaible/bhaible.exp
@@ -25,7 +25,15 @@ global compiler_vendor
# flags to disable warnings for now.
if { [string match $compiler_vendor "gnu"] } {
set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized";
-} else {
+}
+if { [string match $compiler_vendor "microsoft"] } {
+ # -wd4996 suggest use of vsprintf_s instead of vsprintf
+ # -wd4116 unnamed type definition
+ # -wd4101 unreferenced local variable
+ # -wd4244 warning about implicit double to float conversion
+ set warning_options "-wd4996 -wd4116 -wd4101 -wd4244";
+}
+if { ![string match $compiler_vendor "microsoft"] && ![string match $compiler_vendor "gnu"] } {
set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-uninitialized";
}
diff --git a/testsuite/libffi.bhaible/test-call.c b/testsuite/libffi.bhaible/test-call.c
index 82cc79e..5897887 100644
--- a/testsuite/libffi.bhaible/test-call.c
+++ b/testsuite/libffi.bhaible/test-call.c
@@ -25,8 +25,6 @@
#include "alignof.h"
#include <stdarg.h>
-#include "testcases.c"
-
/* libffi testsuite local changes -------------------------------- */
#ifdef DGTEST
/* Redefine exit(1) as a test failure */
@@ -34,7 +32,7 @@
int count = 0;
char rbuf1[2048];
char rbuf2[2048];
-int fprintf(FILE *stream, const char *format, ...)
+int _fprintf(FILE *stream, const char *format, ...)
{
va_list args;
va_start(args, format);
@@ -60,9 +58,12 @@ int fprintf(FILE *stream, const char *format, ...)
return 0;
}
+#define fprintf _fprintf
#endif
/* --------------------------------------------------------------- */
+#include "testcases.c"
+
#ifndef ABI_NUM
#define ABI_NUM FFI_DEFAULT_ABI
#endif
diff --git a/testsuite/libffi.bhaible/test-callback.c b/testsuite/libffi.bhaible/test-callback.c
index 7a435ae..7ddee68 100644
--- a/testsuite/libffi.bhaible/test-callback.c
+++ b/testsuite/libffi.bhaible/test-callback.c
@@ -25,8 +25,6 @@
#include "alignof.h"
#include <stdarg.h>
-#include "testcases.c"
-
/* libffi testsuite local changes -------------------------------- */
#ifdef DGTEST
/* Redefine exit(1) as a test failure */
@@ -34,7 +32,7 @@
int count = 0;
char rbuf1[2048];
char rbuf2[2048];
-int fprintf(FILE *stream, const char *format, ...)
+int _fprintf(FILE *stream, const char *format, ...)
{
va_list args;
va_start(args, format);
@@ -60,9 +58,12 @@ int fprintf(FILE *stream, const char *format, ...)
return 0;
}
+#define fprintf _fprintf
#endif
/* --------------------------------------------------------------- */
+#include "testcases.c"
+
#ifndef ABI_NUM
#define ABI_NUM FFI_DEFAULT_ABI
#endif
diff --git a/testsuite/libffi.call/call.exp b/testsuite/libffi.call/call.exp
index bc2bdc3..ab47415 100644
--- a/testsuite/libffi.call/call.exp
+++ b/testsuite/libffi.call/call.exp
@@ -19,9 +19,22 @@ libffi-init
global srcdir subdir
+if { [string match $compiler_vendor "microsoft"] } {
+ # -wd4005 macro redefinition
+ # -wd4244 implicit conversion to type of smaller size
+ # -wd4305 truncation to smaller type
+ # -wd4477 printf %lu of uintptr_t
+ # -wd4312 implicit conversion to type of greater size
+ # -wd4311 pointer truncation to unsigned long
+ # -EHsc C++ Exception Handling (no SEH exceptions)
+ set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
+} else {
+ set additional_options "";
+}
+
set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]]
-run-many-tests $tlist ""
+run-many-tests $tlist $additional_options
dg-finish