diff --git a/BUILD.gn b/BUILD.gn index e5b64a2f62e4d5..e21616f90f9a87 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -43,6 +43,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { (current_os == "mac" || current_os == "linux") && (host_cpu == "x64" || host_cpu == "arm64" || host_cpu == "arm") enable_pylib = false + + # Build the Linux all clusters app example with default group + chip_build_all_clusters_app = false } if (enable_fuzz_test_targets) { @@ -218,6 +221,16 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { if (build_tv_casting_common_a) { deps += [ "${chip_root}/examples/tv-casting-app/tv-casting-common:tvCastingCommon" ] } + + if (chip_build_all_clusters_app) { + if (is_libfuzzer) { + deps += [ "${chip_root}/examples/all-clusters-app/linux:chip-all-clusters-app-fuzzing" ] + } else { + deps += [ + "${chip_root}/examples/all-clusters-app/linux:chip-all-clusters-app", + ] + } + } } if (chip_build_tools) { diff --git a/scripts/build_coverage.sh b/scripts/build_coverage.sh index 91f5e7f4f0e2a0..d89967f701913a 100755 --- a/scripts/build_coverage.sh +++ b/scripts/build_coverage.sh @@ -46,6 +46,7 @@ CHIP_ROOT=$(_normpath "$(dirname "$0")/..") OUTPUT_ROOT="$CHIP_ROOT/out/coverage" COVERAGE_ROOT="$OUTPUT_ROOT/coverage" skip_gn=false +run_yaml=false help() { @@ -53,6 +54,7 @@ help() { echo "General Options: -h, --help Display this information. + -f, --full Run both yaml and unit tests for unified coverage. Input Options: -o, --output_root Set the build output directory. When set manually, performs only lcov stage on provided build output. Assumes output_root has been built with 'use_coverage=true' @@ -68,6 +70,9 @@ while (($#)); do help exit 1 ;; + --full | -f) + run_yaml=true + ;; --output_root | -o) OUTPUT_ROOT=$2 COVERAGE_ROOT="$OUTPUT_ROOT/coverage" @@ -88,10 +93,27 @@ source "$CHIP_ROOT/scripts/activate.sh" # Generates ninja files if [ "$skip_gn" == false ]; then - gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args='use_coverage=true' + gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args='use_coverage=true chip_build_all_clusters_app=true' + ninja -C "$OUTPUT_ROOT" +fi + +# Run unit tests +if [ "$skip_gn" == false ]; then ninja -C "$OUTPUT_ROOT" check fi +# Run yaml tests +if [ "$run_yaml" == true ]; then + scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --chip-tool ""$OUTPUT_ROOT/chip-tool \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ""$OUTPUT_ROOT/chip-all-clusters-app + " +fi + # Remove unit test itself from coverage statistics find "$OUTPUT_ROOT/obj/src/" -depth -name 'tests' -exec rm -rf {} \;