Skip to content

Commit c017928

Browse files
committed
REXM: TEST: Support testing running on PLATFORM_DRM
1 parent 8161475 commit c017928

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tools/rexm/rexm.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,23 +931,28 @@ int main(int argc, char *argv[])
931931
#if defined(_WIN32)
932932
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
933933
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
934+
#elif defined(PLATFORM_DRM)
935+
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
936+
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1",
937+
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
934938
#else
935939
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: POSIX)\n", exName);
936940
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
937941
#endif
938942

943+
#if !defined(PLATFORM_DRM)
939944
// Build example for PLATFORM_WEB
940945
// Build: raylib.com/examples/<category>/<category>_example_name.html
941946
// Build: raylib.com/examples/<category>/<category>_example_name.data
942947
// Build: raylib.com/examples/<category>/<category>_example_name.wasm
943948
// Build: raylib.com/examples/<category>/<category>_example_name.js
944-
#if defined(_WIN32)
949+
#if defined(_WIN32)
945950
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName);
946951
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
947-
#else
952+
#else
948953
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName);
949954
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
950-
#endif
955+
#endif
951956
// Update generated .html metadata
952957
LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName));
953958
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
@@ -963,6 +968,7 @@ int main(int argc, char *argv[])
963968
TextFormat("%s/%s/%s.wasm", exWebPath, exCategory, exName));
964969
FileCopy(TextFormat("%s/%s/%s.js", exBasePath, exCategory, exName),
965970
TextFormat("%s/%s/%s.js", exWebPath, exCategory, exName));
971+
#endif // !PLATFORM_DRM
966972

967973
// Once example processed, free memory from list
968974
RL_FREE(exBuildList[i]);
@@ -1618,6 +1624,10 @@ int main(int argc, char *argv[])
16181624
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
16191625
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1",
16201626
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
1627+
#elif defined(PLATFORM_DRM)
1628+
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
1629+
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1",
1630+
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
16211631
#else
16221632
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: POSIX)\n", exName);
16231633
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[])
16311641
// STEP 3: Run example with required arguments
16321642
// NOTE: Not easy to retrieve process return value from system(), it's platform dependant
16331643
ChangeDirectory(TextFormat("%s/%s", exBasePath, exCategory));
1644+
1645+
#if defined(_WIN32)
1646+
system(TextFormat("%s --frames 2 > logs/%s.log", exName, exName));
1647+
#else
16341648
system(TextFormat("./%s --frames 2 > logs/%s.log", exName, exName));
1649+
#endif
16351650
#endif
16361651
}
16371652
} break;
@@ -1715,6 +1730,11 @@ int main(int argc, char *argv[])
17151730
{
17161731
#if defined(BUILD_TESTING_WEB)
17171732
if (TextFindIndex(exTestLogLines[k], "WARNING: GL: NPOT") >= 0) continue; // Ignore web-specific warning
1733+
#endif
1734+
#if defined(PLATFORM_DRM)
1735+
if (TextFindIndex(exTestLogLines[k], "WARNING: DISPLAY: No graphic") >= 0) continue; // Ignore specific warning
1736+
if (TextFindIndex(exTestLogLines[k], "WARNING: GetCurrentMonitor()") >= 0) continue; // Ignore specific warning
1737+
if (TextFindIndex(exTestLogLines[k], "WARNING: SetWindowPosition()") >= 0) continue; // Ignore specific warning
17181738
#endif
17191739
if (TextFindIndex(exTestLogLines[k], "WARNING") >= 0) testing[i].warnings++;
17201740
}
@@ -1758,7 +1778,7 @@ int main(int argc, char *argv[])
17581778
|:---------------------------------|:-------:|:-------:|:------:|:-------:|:--------:|:------:|:------:|:------:|:-------:|
17591779
| core_basic window | 0 | 0 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
17601780
*/
1761-
LOG("INFO: [examples_testing.md] Generating examples testing report...\n");
1781+
LOG("INFO: [examples_testing_os.md] Generating examples testing report...\n");
17621782

17631783
char *report = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1);
17641784

0 commit comments

Comments
 (0)