From f3b578bd53b1895b1e28c6aae0949eb1035747e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 18 Sep 2026 12:13:17 -0600 Subject: [PATCH] Build TestMpegCsc on Android too, and say that it needs doing The legacy Android build has a unit test executable of its own, so a new file in unittest/ goes in three build files rather than the two the docs named. Missing the Android one builds fine everywhere it is convenient to try and fails only on Android CI, which is what happened here - so both AGENTS.md and building.md now say three, and which one is easy to forget. Co-Authored-By: Claude Opus 5 (1M context) --- AGENTS.md | 6 ++++-- android/jni/Android.mk | 1 + docs/building.md | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 86b0f3aa3f..812e758400 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -111,8 +111,10 @@ python test.py -g --graphics=software around a hundred failures that mean nothing is wrong. The only meaningful result is `0 tests failed`. (The debug-CRT "Detected memory leaks!" dump after the summary line is normal, not a failure.) -New unit tests are added to `availableTests`; large ones go in their own file in `unittest/`, listed in -both CMakeLists.txt and the Visual Studio project. +New unit tests are added to `availableTests`; large ones go in their own file in `unittest/`, which has +to be listed in **three** build files, not two: `CMakeLists.txt`, `unittest/UnitTests.vcxproj` (and its +`.filters`), and `android/jni/Android.mk`, which builds a unit test executable of its own. Miss the last +one and it builds everywhere you can easily try it, and fails on Android CI. ## Multiplatform considerations diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 63cff285ec..2e0a7ab5a9 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -1060,6 +1060,7 @@ ifeq ($(UNITTEST),1) $(SRC)/unittest/TestVFS.cpp \ $(SRC)/unittest/TestDemangle.cpp \ $(SRC)/unittest/TestLzrc.cpp \ + $(SRC)/unittest/TestMpegCsc.cpp \ $(SRC)/unittest/TestZipSlip.cpp \ $(SRC)/unittest/UnitTest.cpp diff --git a/docs/building.md b/docs/building.md index e7a3c40300..f0a06c7258 100644 --- a/docs/building.md +++ b/docs/building.md @@ -128,7 +128,10 @@ main functions (and also stub out most of the System_ functions as needed). Take when making cross platform changes. New unit tests are added by listing them in availableTests in unittest.cpp. If they are large, put them in -separate files in the unittest subdirectory. Remember to update both CMakeLists.txt and the visual studio project. +separate files in the unittest subdirectory. A new file has to be listed in three build files, not two: +`CMakeLists.txt`, `unittest/UnitTests.vcxproj` (and its `.filters`), and `android/jni/Android.mk`, which +builds a unit test executable of its own. The Android one is the easiest to forget, since missing it builds +fine everywhere you are likely to try it and only fails on Android CI. A unit test is often the first thing to call a given function from outside its own .cpp, which makes the `ppsspp_unittest` target in the legacy Android build (`android/jni/Android.mk`, see above) the strictest check