From 282c4b0eabb41733f2587129a5dd924ce0d2e2d2 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 19 Nov 2025 19:30:25 +0100 Subject: [PATCH] Minor teaks to run on Linux --- tools/rexm/rexm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index e8cb8c93c..6aba90f6f 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -51,9 +51,9 @@ #include "raylib.h" -#include // Required for: NULL, calloc(), free() #include // Required for: rename(), remove() #include // Required for: strcmp(), strcpy() +#include // Required for: NULL, calloc(), free() #define SUPPORT_LOG_INFO #if defined(SUPPORT_LOG_INFO) //&& defined(_DEBUG) @@ -1517,7 +1517,7 @@ int main(int argc, char *argv[]) TextFormat("%s/%s/%s.original.c", exBasePath, exCategory, exName)); char *srcText = LoadFileText(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName)); -#define BUILD_TESTING_WEB +//#define BUILD_TESTING_WEB #if defined(BUILD_TESTING_WEB) static const char *mainReplaceText = "#include \n" @@ -1620,8 +1620,9 @@ int main(int argc, char *argv[]) exBasePath, exCategory, exName, exBasePath, exCategory, exName)); #else LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: POSIX)\n", exName); - system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName)); -#endif + system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", + exBasePath, exCategory, exName, exBasePath, exCategory, exName)); + #endif // Restore original source code before continue FileCopy(TextFormat("%s/%s/%s.original.c", exBasePath, exCategory, exName), TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName)); @@ -1630,7 +1631,7 @@ int main(int argc, char *argv[]) // STEP 3: Run example with required arguments // NOTE: Not easy to retrieve process return value from system(), it's platform dependant ChangeDirectory(TextFormat("%s/%s", exBasePath, exCategory)); - system(TextFormat("%s --frames 2 > logs/%s.log", exName, exName)); + system(TextFormat("./%s --frames 2 > logs/%s.log", exName, exName)); #endif } } break; @@ -1712,7 +1713,9 @@ int main(int argc, char *argv[]) char **exTestLogLines = LoadTextLines(exTestLog, &exTestLogLinesCount); for (int k = 0; k < exTestLogLinesCount; k++) { - if (TextFindIndex(exTestLogLines[k], "WARNING: GL: NPOT") >= 0) continue; // Ignore warning +#if defined(BUILD_TESTING_WEB) + if (TextFindIndex(exTestLogLines[k], "WARNING: GL: NPOT") >= 0) continue; // Ignore web-specific warning +#endif if (TextFindIndex(exTestLogLines[k], "WARNING") >= 0) testing[i].warnings++; } UnloadTextLines(exTestLogLines, exTestLogLinesCount); @@ -1842,6 +1845,7 @@ int main(int argc, char *argv[]) printf(" rename : Rename an existing example\n"); printf(" remove : Remove an existing example\n"); printf(" build : Build example for Desktop and Web platforms\n"); + printf(" test : Build and Test example for Desktop and Web platforms\n"); printf(" validate : Validate examples collection, generates report\n"); printf(" update : Validate and update examples collection, generates report\n\n"); printf("OPTIONS:\n\n");