diff --git a/components/app_trace/CMakeLists.txt b/components/app_trace/CMakeLists.txt index 711a50e50a..151015021a 100644 --- a/components/app_trace/CMakeLists.txt +++ b/components/app_trace/CMakeLists.txt @@ -24,3 +24,5 @@ register_component() # disable --coverage for this component, as it is used as transport # for gcov component_compile_options("-fno-profile-arcs" "-fno-test-coverage") + +target_link_libraries(app_trace gcov) diff --git a/examples/bluetooth/ble_spp_server/sdkconfig.defaults b/examples/bluetooth/ble_spp_server/sdkconfig.defaults index e435f383c8..12f8a9d8f4 100644 --- a/examples/bluetooth/ble_spp_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_spp_server/sdkconfig.defaults @@ -5,7 +5,6 @@ # BT config # CONFIG_BT_ENABLED=y - # # ESP32-specific config # diff --git a/examples/system/console/main/cmd_system.c b/examples/system/console/main/cmd_system.c index b656458295..72d7e50fdc 100644 --- a/examples/system/console/main/cmd_system.c +++ b/examples/system/console/main/cmd_system.c @@ -199,7 +199,7 @@ esptool.py v2.1-beta1 )"; const char* flash_output[] = { -R"(Flashing binaries to serial port )" CONFIG_ESPTOOLPY_PORT R"( (app at offset 0x10000)... +R"(Flashing binaries to serial port (*) (app at offset 0x10000)... esptool.py v2.1-beta1 Connecting.... )", @@ -231,7 +231,7 @@ Hard resetting... const char* monitor_output = R"(MONITOR -)" LOG_COLOR_W R"(--- idf_monitor on )" CONFIG_ESPTOOLPY_PORT R"( 115200 --- +)" LOG_COLOR_W R"(--- idf_monitor on (*) 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H -- )" LOG_RESET_COLOR; diff --git a/examples/system/gcov/README.md b/examples/system/gcov/README.md index 5eefed2d52..1115146cc0 100644 --- a/examples/system/gcov/README.md +++ b/examples/system/gcov/README.md @@ -25,6 +25,9 @@ It will enable coverage info for all source files of your component. If you need `gcov_example.o: CFLAGS += --coverage` Replace `gcov_example.o` with path to your file. + For CMake-based build system, use `component_compile_options(--coverage)` or: ` set_source_files_properties(gcov_example.c PROPERTIES COMPILE_FLAGS --coverage` + + ### Hard-coded Dump Call This method requires `esp_gcov_dump` to be called from your application's code. Below are additional steps which should be performed after the generic ones to obtain coverage info via hard-coded call. Step 1 is already done for this example project. diff --git a/examples/system/gcov/main/CMakeLists.txt b/examples/system/gcov/main/CMakeLists.txt index 170d5c5521..8c9cbd3eaf 100644 --- a/examples/system/gcov/main/CMakeLists.txt +++ b/examples/system/gcov/main/CMakeLists.txt @@ -3,3 +3,7 @@ set(COMPONENT_SRCS "gcov_example.c" set(COMPONENT_ADD_INCLUDEDIRS ".") register_component() + +set_source_files_properties(gcov_example.c + PROPERTIES COMPILE_FLAGS + --coverage) diff --git a/examples/system/ota/native_ota_example/main/CMakeLists.txt b/examples/system/ota/native_ota_example/main/CMakeLists.txt index f7e58ac26a..0c4aeba941 100644 --- a/examples/system/ota/native_ota_example/main/CMakeLists.txt +++ b/examples/system/ota/native_ota_example/main/CMakeLists.txt @@ -1,10 +1,9 @@ set(COMPONENT_SRCS "native_ota_example.c") set(COMPONENT_ADD_INCLUDEDIRS ".") - # Embed the server root certificate into the final binary # # (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -set(COMPONENT_EMBED_TXTFILES ../../server_certs/ca_cert.pem) +set(COMPONENT_EMBED_TXTFILES ${IDF_PATH}/examples/system/ota/server_certs/ca_cert.pem) register_component() diff --git a/examples/system/ota/simple_ota_example/main/CMakeLists.txt b/examples/system/ota/simple_ota_example/main/CMakeLists.txt index 6d7b303916..e54d8b2ce4 100644 --- a/examples/system/ota/simple_ota_example/main/CMakeLists.txt +++ b/examples/system/ota/simple_ota_example/main/CMakeLists.txt @@ -5,7 +5,6 @@ set(COMPONENT_ADD_INCLUDEDIRS ".") # Embed the server root certificate into the final binary # # (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -set(COMPONENT_EMBED_TXTFILES ../../server_certs/ca_cert.pem) - +set(COMPONENT_EMBED_TXTFILES ${IDF_PATH}/examples/system/ota/server_certs/ca_cert.pem) register_component() diff --git a/examples/wifi/simple_wifi/main/CMakeLists.txt b/examples/wifi/simple_wifi/main/CMakeLists.txt new file mode 100644 index 0000000000..e7c00ec94c --- /dev/null +++ b/examples/wifi/simple_wifi/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "simple_wifi.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/tools/ci/build_examples_cmake.sh b/tools/ci/build_examples_cmake.sh index d86d30fbd9..c796c076b1 100755 --- a/tools/ci/build_examples_cmake.sh +++ b/tools/ci/build_examples_cmake.sh @@ -88,8 +88,8 @@ else [ -z ${NUM_OF_JOBS} ] && die "NUM_OF_JOBS is bad" # count number of examples - NUM_OF_EXAMPLES=$(echo ${EXAMPLE_PATHS} | wc -l ) - [ -z ${NUM_OF_EXAMPLES} ] && die "NUM_OF_EXAMPLES is bad" + NUM_OF_EXAMPLES=$( echo "${EXAMPLE_PATHS}" | wc -l ) + [ ${NUM_OF_EXAMPLES} -lt 80 ] && die "NUM_OF_EXAMPLES is bad" # separate intervals #57 / 5 == 12