diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index 0fdc951c8..3a2bc64ec 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -210,7 +210,7 @@ int testsuite_test(int argc, char** argv) #endif /* HAVE_WNR */ printf("\nAll tests passed!\n"); - return EXIT_SUCCESS; + EXIT_TEST(EXIT_SUCCESS); } void simple_test(func_args* args) @@ -411,7 +411,8 @@ int main(int argc, char** argv) if (server_args.return_code != 0) return server_args.return_code; printf("\nAll tests passed!\n"); - return EXIT_SUCCESS; + + EXIT_TEST(EXIT_SUCCESS); } diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 07a488f58..ee186aa27 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -483,7 +483,7 @@ int benchmark_test(void *args) ShowMemoryTracker(); #endif - return 0; + EXIT_TEST(0); } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index fc0fa086e..f8b38871a 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -264,7 +264,8 @@ static int err_sys(const char* msg, int es) { printf("%s error = %d\n", msg, es); - return -1; /* error state */ + + EXIT_TEST(-1); } /* func_args from test.h, so don't have to pull in other junk */ @@ -744,7 +745,7 @@ int wolfcrypt_test(void* args) err_sys("Failed to free netRandom context", -1238); #endif /* HAVE_WNR */ - return args.return_code; + EXIT_TEST(args.return_code); } #endif /* NO_MAIN_DRIVER */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 95fbf5179..c463711b0 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -147,6 +147,9 @@ /* Uncomment next line if building for embOS */ /* #define WOLFSSL_EMBOS */ +/* Uncomment next line if building for RIOT-OS */ +/* #define WOLFSSL_RIOT_OS */ + #include #ifdef WOLFSSL_USER_SETTINGS @@ -408,6 +411,15 @@ #define SINGLE_THREADED /* Not ported at this time */ #endif +#ifdef WOLFSSL_RIOT_OS + #define NO_WRITEV + #define TFM_NO_ASM + #define USE_FAST_MATH + #define NO_FILE_SYSTEM + #define USE_CERT_BUFFERS_2048 + #define HAVE_ECC +#endif + #ifdef WOLFSSL_NRF5x #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8 diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 8a2022808..5d04be8f6 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -407,6 +407,11 @@ #endif #endif /* WOLFSSL_AESNI or WOLFSSL_ARMASM */ + #ifdef WOLFSSL_RIOT_OS + #define EXIT_TEST(ret) exit(ret) + #else + #define EXIT_TEST(ret) return ret + #endif #ifdef __cplusplus } /* extern "C" */