# HG changeset patch # User cslag # Date 1471679265 -7200 # Node ID e63089fe5bef94873b7ba34e0a01aa60adcc53e6 # Parent 5675d34f0a06290f36775b81b3dbae21173c8489 - todo update - removed some duped code for plain* tests diff -r 5675d34f0a06 -r e63089fe5bef ToDo --- a/ToDo Mon Aug 08 11:54:27 2016 +0200 +++ b/ToDo Sat Aug 20 09:47:45 2016 +0200 @@ -46,7 +46,6 @@ -------- - support for return values: aggregate return values - support for argument values: structures, half-precision, vector types, long double -- varargs for mips (might exist, but test all ABIs (mipseb n64 already confirmed)) - consider automatic type-promotion for arguments passed through DC_CALL_C_ELLIPSIS_VARARGS; this would make it easier to just pass arguments instead of having to know about the C type promotions (this is partly done, see todo-item above under 1.0) @@ -55,11 +54,11 @@ * linux - other syscalls - MIPS32 softfloat support (-msoft-float) -- MIPS64 little-endian needs testing (current port works on openbsd/octeon, which is big endian) - test MIPS32 eabi big endian (current port works on psp, which is little endian) - implement MIPS64 N32 (gcc -mabi=n32); both, little and big-endian (looks like NetNBSD on and EdgeRouter lite uses this: https://blog.netbsd.org/tnf/entry/hands_on_experience_with_edgerouter) - implement MIPS64 EABI (gcc -mabi=eabi); both, little and big-endian +- support for Minix/arm dynload: -------- @@ -81,10 +80,10 @@ - finish PPC32 callbacks (see bugs section, below, BSD not working) - MIPS32 softfloat support (-msoft-float) - test MIPS32 eabi big endian (current port works on psp, which is little endian) -- test MIPS64 n64 little endian (current port works on openbsd/octeon, which is big endian) - implement MIPS64 N32 (gcc -mabi=n32); both, little and big-endian (looks like NetNBSD on and EdgeRouter lite uses this: https://blog.netbsd.org/tnf/entry/hands_on_experience_with_edgerouter) - implement MIPS64 EABI (gcc -mabi=eabi); both, little and big-endian +- support for Minix/arm bindings: --------- diff -r 5675d34f0a06 -r e63089fe5bef dyncall/dyncall_macros.h --- a/dyncall/dyncall_macros.h Mon Aug 08 11:54:27 2016 +0200 +++ b/dyncall/dyncall_macros.h Sat Aug 20 09:47:45 2016 +0200 @@ -244,6 +244,7 @@ # else # define DC__ABI_MIPS_EABI # endif +/*@@@implement/support: __mips_hard_float*/ #endif /* MIPS */ #if defined(DC__Arch_PPC64) diff -r 5675d34f0a06 -r e63089fe5bef test/common/test_framework.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/common/test_framework.h Sat Aug 20 09:47:45 2016 +0200 @@ -0,0 +1,68 @@ +/* + + Package: dyncall + Library: test + File: test/plain_c++/test_framework.h + Description: + License: + + Copyright (c) 2007-2015 Daniel Adler , + Tassilo Philipp + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +*/ + + + +// 2007-10-11 + +#ifndef TRUE +#define TRUE (1) +#endif + +#ifndef FALSE +#define FALSE (0) +#endif + +// Statement breaking into debugger (for various platforms). @@@add if defined, etc... +#ifdef _WIN32 +# ifdef _MSC_VER +# define DC_TEST_BREAK __debugbreak +# else +# include +# define DC_TEST_BREAK DebugBreak +# endif +#else +# define DC_TEST_BREAK +#endif + +// Test state - evaluates to false inside a test function if a test fails. +#define DC_TEST_STATE testFramework_state + +// Test functions defined by DC_DEFINE_TEST_FUNC_BEGIN and DC_DEFINE_TEST_FUNC_END pairs do come with +// a default parameter used to pass a path to them specifying where to find external data needed to +// run the tests (if desired). NULL by default. It can be queried by using DC_TEST_PATH. +#define DC_TEST_PATH testFramework_suitePath + +// Test a single expression - the expression must evaluate to true in order to succeed. +// #define DC_TEST(exp) { TEST_STATE = TEST_STATE && (exp); if(!TEST_STATE) DC_TEST_BREAK(); } + +#include + +#define DC_TEST(exp) assert(exp) +// { if (! (exp) ) DC_TEST_BREAK(); } + +// Macros used to define a test functions. +#define DC_DEFINE_TEST_FUNC_BEGIN(name) /*static */int name(/*const char* DC_TEST_PATH=NULL*/) { /*@@@ add logging*/ int TEST_STATE = TRUE; +#define DC_DEFINE_TEST_FUNC_END /*@@@ add logging*/ return TEST_STATE; } diff -r 5675d34f0a06 -r e63089fe5bef test/plain/test_framework.h --- a/test/plain/test_framework.h Mon Aug 08 11:54:27 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* - - Package: dyncall - Library: test - File: test/plain/test_framework.h - Description: - License: - - Copyright (c) 2007-2015 Daniel Adler , - Tassilo Philipp - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -*/ - - - - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef FALSE -#define FALSE (0) -#endif - -// Statement breaking into debugger (for various platforms). @@@add if defined, etc... -#ifdef _WIN32 -# ifdef _MSC_VER -# define DC_TEST_BREAK __debugbreak -# else -# include -# define DC_TEST_BREAK DebugBreak -# endif -#else -# define DC_TEST_BREAK -#endif - -// Test state - evaluates to false inside a test function if a test fails. -#define DC_TEST_STATE testFramework_state - -// Test functions defined by DC_DEFINE_TEST_FUNC_BEGIN and DC_DEFINE_TEST_FUNC_END pairs do come with -// a default parameter used to pass a path to them specifying where to find external data needed to -// run the tests (if desired). NULL by default. It can be queried by using DC_TEST_PATH. -#define DC_TEST_PATH testFramework_suitePath - -// Test a single expression - the expression must evaluate to true in order to succeed. -// #define DC_TEST(exp) { TEST_STATE = TEST_STATE && (exp); if(!TEST_STATE) DC_TEST_BREAK(); } - -#include - -#define DC_TEST(exp) assert(exp) -// { if (! (exp) ) DC_TEST_BREAK(); } - -// Macros used to define a test functions. -#define DC_DEFINE_TEST_FUNC_BEGIN(name) /*static */int name(/*const char* DC_TEST_PATH=NULL*/) { /*@@@ add logging*/ int TEST_STATE = TRUE; -#define DC_DEFINE_TEST_FUNC_END /*@@@ add logging*/ return TEST_STATE; } diff -r 5675d34f0a06 -r e63089fe5bef test/plain/test_main.c --- a/test/plain/test_main.c Mon Aug 08 11:54:27 2016 +0200 +++ b/test/plain/test_main.c Sat Aug 20 09:47:45 2016 +0200 @@ -26,7 +26,7 @@ -#include "test_framework.h" +#include "../common/test_framework.h" #include "../../dyncall/dyncall.h" #include "../common/platformInit.h" #include "../common/platformInit.c" /* Impl. for functions only used in this translation unit */ diff -r 5675d34f0a06 -r e63089fe5bef test/plain/test_structs.c --- a/test/plain/test_structs.c Mon Aug 08 11:54:27 2016 +0200 +++ b/test/plain/test_structs.c Sat Aug 20 09:47:45 2016 +0200 @@ -25,7 +25,7 @@ -#include "test_framework.h" +#include "../common/test_framework.h" #include "../../dyncall/dyncall.h" #include "../../dyncall/dyncall_signature.h" #include "../../dyncall/dyncall_struct.h" diff -r 5675d34f0a06 -r e63089fe5bef test/plain_c++/test_framework.h --- a/test/plain_c++/test_framework.h Mon Aug 08 11:54:27 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* - - Package: dyncall - Library: test - File: test/plain_c++/test_framework.h - Description: - License: - - Copyright (c) 2007-2015 Daniel Adler , - Tassilo Philipp - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -*/ - - - -// 2007-10-11 - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef FALSE -#define FALSE (0) -#endif - -// Statement breaking into debugger (for various platforms). @@@add if defined, etc... -#ifdef _WIN32 -# ifdef _MSC_VER -# define DC_TEST_BREAK __debugbreak -# else -# include -# define DC_TEST_BREAK DebugBreak -# endif -#else -# define DC_TEST_BREAK -#endif - -// Test state - evaluates to false inside a test function if a test fails. -#define DC_TEST_STATE testFramework_state - -// Test functions defined by DC_DEFINE_TEST_FUNC_BEGIN and DC_DEFINE_TEST_FUNC_END pairs do come with -// a default parameter used to pass a path to them specifying where to find external data needed to -// run the tests (if desired). NULL by default. It can be queried by using DC_TEST_PATH. -#define DC_TEST_PATH testFramework_suitePath - -// Test a single expression - the expression must evaluate to true in order to succeed. -// #define DC_TEST(exp) { TEST_STATE = TEST_STATE && (exp); if(!TEST_STATE) DC_TEST_BREAK(); } - -#include - -#define DC_TEST(exp) assert(exp) -// { if (! (exp) ) DC_TEST_BREAK(); } - -// Macros used to define a test functions. -#define DC_DEFINE_TEST_FUNC_BEGIN(name) /*static */int name(/*const char* DC_TEST_PATH=NULL*/) { /*@@@ add logging*/ int TEST_STATE = TRUE; -#define DC_DEFINE_TEST_FUNC_END /*@@@ add logging*/ return TEST_STATE; } diff -r 5675d34f0a06 -r e63089fe5bef test/plain_c++/test_main.cc --- a/test/plain_c++/test_main.cc Mon Aug 08 11:54:27 2016 +0200 +++ b/test/plain_c++/test_main.cc Sat Aug 20 09:47:45 2016 +0200 @@ -26,7 +26,7 @@ -#include "test_framework.h" +#include "../common/test_framework.h" #include "../../dyncall/dyncall.h" #include "../common/platformInit.h" #include "../common/platformInit.c" /* Impl. for functions only used in this translation unit */