REXM: TEST: Support testing running on PLATFORM_DRM

This commit is contained in:
Ray 2025-11-20 00:59:28 +01:00
parent 8161475c28
commit c0179288ba

View File

@ -931,11 +931,16 @@ int main(int argc, char *argv[])
#if defined(_WIN32) #if defined(_WIN32)
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName); LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName)); system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
#elif defined(PLATFORM_DRM)
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1",
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
#else #else
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: POSIX)\n", exName); 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)); system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
#endif #endif
#if !defined(PLATFORM_DRM)
// Build example for PLATFORM_WEB // Build example for PLATFORM_WEB
// Build: raylib.com/examples/<category>/<category>_example_name.html // Build: raylib.com/examples/<category>/<category>_example_name.html
// Build: raylib.com/examples/<category>/<category>_example_name.data // Build: raylib.com/examples/<category>/<category>_example_name.data
@ -963,6 +968,7 @@ int main(int argc, char *argv[])
TextFormat("%s/%s/%s.wasm", exWebPath, exCategory, exName)); TextFormat("%s/%s/%s.wasm", exWebPath, exCategory, exName));
FileCopy(TextFormat("%s/%s/%s.js", exBasePath, exCategory, exName), FileCopy(TextFormat("%s/%s/%s.js", exBasePath, exCategory, exName),
TextFormat("%s/%s/%s.js", exWebPath, exCategory, exName)); TextFormat("%s/%s/%s.js", exWebPath, exCategory, exName));
#endif // !PLATFORM_DRM
// Once example processed, free memory from list // Once example processed, free memory from list
RL_FREE(exBuildList[i]); RL_FREE(exBuildList[i]);
@ -1618,6 +1624,10 @@ int main(int argc, char *argv[])
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName); LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1",
exBasePath, exCategory, exName, exBasePath, exCategory, exName)); exBasePath, exCategory, exName, exBasePath, exCategory, exName));
#elif defined(PLATFORM_DRM)
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1",
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
#else #else
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: POSIX)\n", exName); LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: POSIX)\n", exName);
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1", system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1",
@ -1631,7 +1641,12 @@ int main(int argc, char *argv[])
// STEP 3: Run example with required arguments // STEP 3: Run example with required arguments
// NOTE: Not easy to retrieve process return value from system(), it's platform dependant // NOTE: Not easy to retrieve process return value from system(), it's platform dependant
ChangeDirectory(TextFormat("%s/%s", exBasePath, exCategory)); ChangeDirectory(TextFormat("%s/%s", exBasePath, exCategory));
#if defined(_WIN32)
system(TextFormat("%s --frames 2 > logs/%s.log", exName, exName));
#else
system(TextFormat("./%s --frames 2 > logs/%s.log", exName, exName)); system(TextFormat("./%s --frames 2 > logs/%s.log", exName, exName));
#endif
#endif #endif
} }
} break; } break;
@ -1715,6 +1730,11 @@ int main(int argc, char *argv[])
{ {
#if defined(BUILD_TESTING_WEB) #if defined(BUILD_TESTING_WEB)
if (TextFindIndex(exTestLogLines[k], "WARNING: GL: NPOT") >= 0) continue; // Ignore web-specific warning if (TextFindIndex(exTestLogLines[k], "WARNING: GL: NPOT") >= 0) continue; // Ignore web-specific warning
#endif
#if defined(PLATFORM_DRM)
if (TextFindIndex(exTestLogLines[k], "WARNING: DISPLAY: No graphic") >= 0) continue; // Ignore specific warning
if (TextFindIndex(exTestLogLines[k], "WARNING: GetCurrentMonitor()") >= 0) continue; // Ignore specific warning
if (TextFindIndex(exTestLogLines[k], "WARNING: SetWindowPosition()") >= 0) continue; // Ignore specific warning
#endif #endif
if (TextFindIndex(exTestLogLines[k], "WARNING") >= 0) testing[i].warnings++; if (TextFindIndex(exTestLogLines[k], "WARNING") >= 0) testing[i].warnings++;
} }
@ -1758,7 +1778,7 @@ int main(int argc, char *argv[])
|:---------------------------------|:-------:|:-------:|:------:|:-------:|:--------:|:------:|:------:|:------:|:-------:| |:---------------------------------|:-------:|:-------:|:------:|:-------:|:--------:|:------:|:------:|:------:|:-------:|
| core_basic window | 0 | 0 | | | | | | | | | core_basic window | 0 | 0 | | | | | | | |
*/ */
LOG("INFO: [examples_testing.md] Generating examples testing report...\n"); LOG("INFO: [examples_testing_os.md] Generating examples testing report...\n");
char *report = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1); char *report = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1);