diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d89ea..61783dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The enabled categories are now compiled in and `esettings` and `ebot` are linked. The test fails when no check runs, and when the number of categories it checked differs from the number of `EAPPS_BUILD_` options that are ON. +- A `-DBUILD_TESTING=ON` build with `EAPPS_BUILD_CONNECTIVITY=OFF` failed to link (`library 'eremote' not found`, + `library 'ewifi' not found`): `tests/CMakeLists.txt` built `test_eremote`, `test_ewifi` and `test_ewifi_shellsafe` + unconditionally. Those three tests are now only built when the connectivity apps are. ## [3.0.1] - 2026-05-16 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c7612cd..4bac7a3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,29 +19,37 @@ foreach(test ${TEST_SOURCES}) add_test(NAME ${test} COMMAND ${test}) endforeach() -# eRemote engine tests -add_executable(test_eremote test_eremote.c) -target_link_libraries(test_eremote PRIVATE eapps_common eapps_ui eremote) -if(NOT MSVC) - target_link_libraries(test_eremote PRIVATE m) -endif() -add_test(NAME test_eremote COMMAND test_eremote) +# eRemote and eWiFi are connectivity apps: the top-level CMakeLists.txt only +# adds apps/eremote and apps/ewifi when EAPPS_BUILD_CONNECTIVITY is ON, so their +# tests can only be built then. Otherwise the linker is handed the bare names +# "eremote" and "ewifi" and fails with "library not found". +if(EAPPS_BUILD_CONNECTIVITY) + # eRemote engine tests + add_executable(test_eremote test_eremote.c) + target_link_libraries(test_eremote PRIVATE eapps_common eapps_ui eremote) + if(NOT MSVC) + target_link_libraries(test_eremote PRIVATE m) + endif() + add_test(NAME test_eremote COMMAND test_eremote) -# eWiFi engine + vault + validation tests -add_executable(test_ewifi test_ewifi.c) -target_link_libraries(test_ewifi PRIVATE eapps_common eapps_ui ewifi) -if(NOT MSVC) - target_link_libraries(test_ewifi PRIVATE m) -endif() -add_test(NAME test_ewifi COMMAND test_ewifi) + # eWiFi engine + vault + validation tests + add_executable(test_ewifi test_ewifi.c) + target_link_libraries(test_ewifi PRIVATE eapps_common eapps_ui ewifi) + if(NOT MSVC) + target_link_libraries(test_ewifi PRIVATE m) + endif() + add_test(NAME test_ewifi COMMAND test_ewifi) -# eWiFi shell-argument hardening — SSIDs reach system()/popen() -add_executable(test_ewifi_shellsafe test_ewifi_shellsafe.c) -target_link_libraries(test_ewifi_shellsafe PRIVATE eapps_common eapps_ui ewifi) -if(NOT MSVC) - target_link_libraries(test_ewifi_shellsafe PRIVATE m) + # eWiFi shell-argument hardening — SSIDs reach system()/popen() + add_executable(test_ewifi_shellsafe test_ewifi_shellsafe.c) + target_link_libraries(test_ewifi_shellsafe PRIVATE eapps_common eapps_ui ewifi) + if(NOT MSVC) + target_link_libraries(test_ewifi_shellsafe PRIVATE m) + endif() + add_test(NAME test_ewifi_shellsafe COMMAND test_ewifi_shellsafe) +else() + message(STATUS "test_eremote, test_ewifi, test_ewifi_shellsafe skipped: EAPPS_BUILD_CONNECTIVITY is OFF") endif() -add_test(NAME test_ewifi_shellsafe COMMAND test_ewifi_shellsafe) # App lifecycle tests — needs all app libraries # test_app_lifecycle.c checks each category only under #ifdef EAPPS_BUILD_,