diff --git a/.gitlab/ci/host-test.yml b/.gitlab/ci/host-test.yml index 9f31b9909a..3ed2cac064 100644 --- a/.gitlab/ci/host-test.yml +++ b/.gitlab/ci/host-test.yml @@ -369,4 +369,5 @@ test_linux_example: script: - cd ${IDF_PATH}/examples/build_system/cmake/linux_host_app - idf.py build - - build/linux_host_app.elf + - timeout 5 ./build/linux_host_app.elf >test.log || true + - grep "Restarting" test.log diff --git a/examples/build_system/cmake/linux_host_app/main/linux_host_app.cpp b/examples/build_system/cmake/linux_host_app/main/linux_host_app.cpp index c51a9fb764..7c646d1743 100644 --- a/examples/build_system/cmake/linux_host_app/main/linux_host_app.cpp +++ b/examples/build_system/cmake/linux_host_app/main/linux_host_app.cpp @@ -8,13 +8,23 @@ */ #include "stdio.h" +#include void app_main() { - printf("Hello, Host!\n"); + while(1) { + printf("Hello, Host!\n"); + + for (int i = 10; i >= 0; i--) { + printf("Restarting in %d seconds...\n", i); + sleep(1); + } + } } int main(int argc, char **argv) { + setbuf(stdout, NULL); app_main(); + return 0; }