Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_<CATEGORY>` 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

Expand Down
48 changes: 28 additions & 20 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Category link failure can recur unnoticed

When a later change removes or bypasses the connectivity guard, the category CI job configures without BUILD_TESTING, and no committed check builds a non-connectivity category with tests enabled. Removing this guard would therefore restore the link failure without CI detecting it.

Add an automated test-enabled non-connectivity category build to CI so this configuration is checked for link failures.

Prompt for AI agents
In `tests/CMakeLists.txt` at line 26:

**Category link failure can recur unnoticed**

When a later change removes or bypasses the connectivity guard, the category CI job configures without `BUILD_TESTING`, and no committed check builds a non-connectivity category with tests enabled. Removing this guard would therefore restore the link failure without CI detecting it.

Add an automated test-enabled non-connectivity category build to CI so this configuration is checked for link failures.

From TESTING.md L12:

- **Regression** — every fixed defect gets a test that would have caught it.

# 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_<CATEGORY>,
Expand Down
Loading