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