Repository navigation
test(lifecycle): compile the app checks into test_app_lifecycle #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,28 +44,55 @@ 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>, | ||
| # so every enabled category must also be passed as a compile definition. Without | ||
| # them the test compiled to an empty main() and passed with 0 assertions. | ||
| # esettings is a system app (always built, top-level CMakeLists.txt), so it is | ||
| # linked whenever the productivity checks that reference it are compiled. | ||
| # LIFECYCLE_EXPECTED counts the enabled categories straight from the options, not | ||
| # from LIFECYCLE_DEFS, so the test fails if a category's define is ever dropped. | ||
| set(LIFECYCLE_LIBS eapps_common eapps_ui) | ||
| set(LIFECYCLE_DEFS) | ||
| set(LIFECYCLE_EXPECTED 0) | ||
| foreach(category PRODUCTIVITY MEDIA GAMES CONNECTIVITY SECURITY WEB) | ||
| if(EAPPS_BUILD_${category}) | ||
| math(EXPR LIFECYCLE_EXPECTED "${LIFECYCLE_EXPECTED} + 1") | ||
| endif() | ||
| endforeach() | ||
| if(EAPPS_BUILD_PRODUCTIVITY) | ||
| list(APPEND LIFECYCLE_LIBS ecal enote econverter ebuffer efiles ecleaner eclock etools etimer epdf ezip eviewer esession) | ||
| list(APPEND LIFECYCLE_LIBS ecal enote econverter ebuffer efiles ecleaner eclock etools etimer epdf ezip eviewer esession esettings) | ||
| list(APPEND LIFECYCLE_DEFS EAPPS_BUILD_PRODUCTIVITY) | ||
| endif() | ||
| if(EAPPS_BUILD_MEDIA) | ||
| list(APPEND LIFECYCLE_LIBS emusic evideo egallery eplay epaint) | ||
| list(APPEND LIFECYCLE_DEFS EAPPS_BUILD_MEDIA) | ||
| endif() | ||
| if(EAPPS_BUILD_GAMES) | ||
| list(APPEND LIFECYCLE_LIBS snake tetris minesweeper dice erunner esurfer echess ebirds eslice eblocks ecrush) | ||
| list(APPEND LIFECYCLE_DEFS EAPPS_BUILD_GAMES) | ||
| endif() | ||
| if(EAPPS_BUILD_CONNECTIVITY) | ||
| list(APPEND LIFECYCLE_LIBS eftp eserial essh evnc etunnel echat eremote ewifi) | ||
| list(APPEND LIFECYCLE_DEFS EAPPS_BUILD_CONNECTIVITY) | ||
| endif() | ||
| if(EAPPS_BUILD_SECURITY) | ||
| list(APPEND LIFECYCLE_LIBS evpn eguard evirustower) | ||
| list(APPEND LIFECYCLE_LIBS evpn eguard evirustower ebot) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Windows gcc builds cannot link the test Adding ebot to LIFECYCLE_LIBS makes the security-enabled lifecycle executable pull in ebot.c, which calls Winsock functions without a CMake link dependency on ws2_32. On Windows GCC builds, the source's MSVC-specific link pragma does not supply that library, leaving the test executable with unresolved socket symbols. Agent Prompt
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Lifecycle test cannot link When Only append Prompt for AI agentsIn `tests/CMakeLists.txt` at line 79:
**Lifecycle test cannot link**
When `EAPPS_BUILD_SECURITY` is ON and no `lvgl` target is available, `tests/CMakeLists.txt` appends `ebot` to `LIFECYCLE_LIBS` while `apps/ebot/CMakeLists.txt` skips creating that target, so the lifecycle test fails to link and the build fails.
Only append `ebot` to `LIFECYCLE_LIBS` when its target is created.From Preserve platform portability and existing public catalog fields. |
||
| list(APPEND LIFECYCLE_DEFS EAPPS_BUILD_SECURITY) | ||
| endif() | ||
| if(EAPPS_BUILD_WEB) | ||
| list(APPEND LIFECYCLE_LIBS eweb) | ||
| list(APPEND LIFECYCLE_DEFS EAPPS_BUILD_WEB) | ||
| endif() | ||
| add_executable(test_app_lifecycle test_app_lifecycle.c) | ||
| target_link_libraries(test_app_lifecycle PRIVATE ${LIFECYCLE_LIBS}) | ||
| if(NOT MSVC) | ||
| target_link_libraries(test_app_lifecycle PRIVATE m) | ||
| # With every category switched off there is nothing to check, so no test. | ||
| if(LIFECYCLE_EXPECTED GREATER 0) | ||
| add_executable(test_app_lifecycle test_app_lifecycle.c) | ||
| target_link_libraries(test_app_lifecycle PRIVATE ${LIFECYCLE_LIBS}) | ||
| target_compile_definitions(test_app_lifecycle PRIVATE ${LIFECYCLE_DEFS} | ||
| EAPPS_LIFECYCLE_EXPECTED_CATEGORIES=${LIFECYCLE_EXPECTED}) | ||
|
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Missing app names crash the lifecycle test The newly compiled category checks use CHECK_APP, which records a NULL id or name but then calls strlen on that pointer without stopping. If an app has the missing metadata this test is meant to detect, execution can terminate before TEST_EXIT summarizes the assertion failure or checks the remaining apps. Agent Prompt
|
||
| if(NOT MSVC) | ||
| target_link_libraries(test_app_lifecycle PRIVATE m) | ||
| endif() | ||
| add_test(NAME test_app_lifecycle COMMAND test_app_lifecycle) | ||
| else() | ||
| message(STATUS "test_app_lifecycle skipped: every EAPPS_BUILD_<CATEGORY> option is OFF") | ||
| endif() | ||
| add_test(NAME test_app_lifecycle COMMAND test_app_lifecycle) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Release notes omit pending additions
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsDismiss ↗ | View ↗