diff --git a/src/test/greatest.h b/src/test/greatest.h index 6a41c73e..b43017b2 100644 --- a/src/test/greatest.h +++ b/src/test/greatest.h @@ -83,10 +83,18 @@ int main(int argc, char **argv) { #define GREATEST_DEFAULT_WIDTH 72 #endif +#ifdef ANDROID +#include +#define GREATEST_STDOUT NULL +#define fprintf(fp, ...) __android_log_print(ANDROID_LOG_ERROR, "greatest", __VA_ARGS__) +#endif + /* FILE *, for test logging. */ +#ifndef ANDROID #ifndef GREATEST_STDOUT #define GREATEST_STDOUT stdout #endif +#endif /* Remove GREATEST_ prefix from most commonly used symbols? */ #ifndef GREATEST_USE_ABBREVS diff --git a/src/test/testcpu.c b/src/test/testcpu.c index c8b1825c..62cd71b3 100644 --- a/src/test/testcpu.c +++ b/src/test/testcpu.c @@ -7805,7 +7805,7 @@ int test_cpu(int argc, char **argv) { GREATEST_MAIN_END(); } -#if !defined(__APPLE__) +#if !defined(__APPLE__) && !defined(ANDROID) int main(int argc, char **argv) { test_cpu(argc, argv); }