Lines Matching +full:ninja +full:- +full:build

33 set -euo pipefail
35 OT_BUILDDIR="${OT_BUILDDIR:-${PWD}/build}"
53 OT_NODE_TYPE="${OT_NODE_TYPE:-cli}"
56 OT_NATIVE_IP="${OT_NATIVE_IP:-0}"
59 THREAD_VERSION="${THREAD_VERSION:-1.4}"
62 INTER_OP="${INTER_OP:-0}"
65 VERBOSE="${VERBOSE:-0}"
68 BORDER_ROUTING="${BORDER_ROUTING:-1}"
71 NAT64="${NAT64:-0}"
74 NAT64_SERVICE="${NAT64_SERVICE:-openthread}"
77 INTER_OP_BBR="${INTER_OP_BBR:-0}"
80 OT_COREDUMP_DIR="${PWD}/ot-core-dump"
83 FULL_LOGS=${FULL_LOGS:-0}
86 TREL=${TREL:-0}
89 LOCAL_OTBR_DIR=${LOCAL_OTBR_DIR:-""}
96 "-DBUILD_TESTING=ON"
97 "-DOT_ANYCAST_LOCATOR=ON"
98 "-DOT_DNS_CLIENT=ON"
99 "-DOT_DNS_DSO=ON"
100 "-DOT_DNSSD_SERVER=ON"
101 "-DOT_ECDSA=ON"
102 "-DOT_EXTERNAL_HEAP=ON"
103 "-DOT_HISTORY_TRACKER=ON"
104 "-DOT_MESSAGE_USE_HEAP=OFF"
105 "-DOT_NETDATA_PUBLISHER=ON"
106 "-DOT_PING_SENDER=ON"
107 "-DOT_PLATFORM_LOG_CRASH_DUMP=ON"
108 "-DOT_REFERENCE_DEVICE=ON"
109 "-DOT_SERVICE=ON"
110 "-DOT_SRP_CLIENT=ON"
111 "-DOT_SRP_SERVER=ON"
112 "-DOT_UPTIME=ON"
113 "-DOT_THREAD_VERSION=${version}"
117 options+=("-DOT_FULL_LOGS=ON")
121 options+=("-DOT_DUA=ON")
122 options+=("-DOT_MLR=ON")
126 options+=("-DOT_SIMULATION_VIRTUAL_TIME=ON")
130 options+=("-DOT_CSL_RECEIVER=ON")
131 options+=("-DOT_LINK_METRICS_INITIATOR=ON")
132 options+=("-DOT_LINK_METRICS_SUBJECT=ON")
133 options+=("-DOT_LINK_METRICS_MANAGER=ON")
134 options+=("-DOT_WAKEUP_COORDINATOR=ON")
135 options+=("-DOT_WAKEUP_END_DEVICE=ON")
144 …# causing the ot-cli POSIX app to send the reset to simulation RCP successfully instead of p…
146 options+=("-DOT_PLATFORM_BOOTLOADER_MODE=ON")
154 options+=("-DOT_SIMULATION_INFRA_IF=OFF")
157 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}" "${OT_SRCDIR}"/script/cmake-b…
160 …ARGET=ot-rcp OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}" "${OT_SRCDIR}"/s…
165 options+=("-DOT_BACKBONE_ROUTER=ON")
167 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}-bbr" "${OT_SRCDIR}"/script/cma…
170 …GET=ot-rcp OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}-bbr" "${OT_SRCDIR}"…
180 "-DBUILD_TESTING=ON"
181 "-DOT_MESSAGE_USE_HEAP=ON"
182 "-DOT_PLATFORM_BOOTLOADER_MODE=ON"
183 "-DOT_PLATFORM_LOG_CRASH_DUMP=ON"
184 "-DOT_THREAD_VERSION=${version}"
188 options+=("-DOT_DUA=ON")
189 options+=("-DOT_MLR=ON")
190 options+=("-DOT_LINK_METRICS_INITIATOR=ON")
191 options+=("-DOT_LINK_METRICS_SUBJECT=ON")
192 options+=("-DOT_LINK_METRICS_MANAGER=ON")
196 options+=("-DOT_FULL_LOGS=ON")
200 options+=("-DOT_POSIX_VIRTUAL_TIME=ON")
204 options+=("-DOT_PLATFORM_UDP=ON" "-DOT_PLATFORM_NETIF=ON")
211 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-posix-${version}" "${OT_SRCDIR}"/script/cmake-build
215 options+=("-DOT_BACKBONE_ROUTER=ON")
217 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-posix-${version}-bbr" "${OT_SRCDIR}"/script/cmake-bu…
243 ./script/gcda-tool clean
244 rm -rfv "${OT_BUILDDIR}" || sudo rm -rfv "${OT_BUILDDIR}"
250 local builddir="${OT_BUILDDIR}/openthread-simulation-${version}"
252 if [[ ! -d ${builddir} ]]; then
253 echo "Cannot find build directory: ${builddir}"
259 ninja test
268 do_unit_version "1.4-bbr"
274 export top_builddir="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}"
278 rcp | rcp-cli | cli)
281 rcp-ncp | ncp)
282 export NODE_TYPE=ncp-sim
287 export top_builddir_1_4_bbr="${OT_BUILDDIR}/openthread-simulation-1.4-bbr"
289 export top_builddir_1_1="${OT_BUILDDIR}/openthread-simulation-1.1"
293 export PYTHONPATH=tests/scripts/thread-cert
295 [[ ! -d tmp ]] || rm -rvf tmp
302 export top_builddir="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}"
306 export top_builddir_1_4_bbr="${OT_BUILDDIR}/openthread-simulation-1.4-bbr"
308 export top_builddir_1_1="${OT_BUILDDIR}/openthread-simulation-1.1"
312 export PYTHONPATH=tests/scripts/thread-cert
317 mkdir -p ot_testing
318 …./tests/scripts/thread-cert/run_cert_suite.py --run-directory ot_testing --multiply "${MULTIPLY:-1…
324 echo "Downloading thread-wireshark from https://github.com/openthread/wireshark/releases ..."
325 …rl=https://github.com/openthread/wireshark/releases/download/ot-pktverify-20200727/thread-wireshar…
326 local save_file=/tmp/thread-wireshark.tar.gz
328 rm -rf /tmp/thread-wireshark || true
329 rm -rf "${save_file}" || true
330 curl -L "${download_url}" -o "${save_file}"
331 tar -C /tmp -xvzf "${save_file}"
333 LD_LIBRARY_PATH=/tmp/thread-wireshark /tmp/thread-wireshark/tshark -v
334 LD_LIBRARY_PATH=/tmp/thread-wireshark /tmp/thread-wireshark/dumpcap -v
335 rm -rf "${save_file}"
344 "-DOT_ANYCAST_LOCATOR=ON"
345 "-DOT_COVERAGE=ON"
346 "-DOT_DNS_CLIENT=ON"
347 "-DOT_DUA=ON"
348 "-DOT_MLR=ON"
349 "-DOT_NETDATA_PUBLISHER=ON"
350 "-DOT_SLAAC=ON"
351 "-DOT_SRP_CLIENT=ON"
352 "-DOT_FULL_LOGS=ON"
353 "-DOT_UPTIME=ON"
354 "-DOTBR_DNS_UPSTREAM_QUERY=ON"
355 "-DOTBR_DUA_ROUTING=ON"
356 "-DOTBR_DHCP6_PD=ON"
369 "MDNS=${OTBR_MDNS:-mDNSResponder}"
370 "FIREWALL=${FIREWALL:-1}"
375 … otbr_options+=("-DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_DNSSD_SERVER_BIND_UNSPECIFIED_NETIF=1'")
379 otbr_options+=("-DOTBR_TREL=ON")
381 otbr_options+=("-DOTBR_TREL=OFF")
384 local otbr_docker_image=${OTBR_DOCKER_IMAGE:-otbr-ot12-backbone-ci}
388 docker_build_args+=("--build-arg" "$arg")
391 otbrdir=$(mktemp -d -t otbr_XXXXXX)
395 if [[ -z ${LOCAL_OTBR_DIR} ]]; then
396 … ./script/git-tool clone https://github.com/openthread/ot-br-posix.git --depth 1 "${otbrdir}"
398 rsync -r \
399 --exclude=third_party/openthread/repo \
400 --exclude=.git \
401 --exclude=build \
407 rm -rf third_party/openthread/repo
408 rsync -r \
409 --exclude=build \
410 --exclude=ot_testing \
411 --exclude=__pycache__ \
414 rm -rf .git
416 docker build -t "${otbr_docker_image}" -f etc/docker/Dockerfile . \
418 --build-arg OTBR_OPTIONS="${otbr_options[*]}"
421 rm -rf "${otbrdir}"
426 ./tests/scripts/thread-cert/pktverify/verify.py "$1"
434 echo -e "\n${OT_COLOR_PASS}EXEC${OT_COLOR_NONE} ${script}"
435 sudo killall ot-rcp || true
436 sudo killall ot-cli || true
437 sudo killall ot-cli-ftd || true
438 sudo killall ot-cli-mtd || true
439 sudo rm -rf tmp
443 sudo -E expect -df "${script}" 2>"${log_file}"
445 expect -df "${script}" 2>"${log_file}"
450 …# The exit status 77 for skipping is inherited from automake's test driver for script-based testsu…
452 echo -e "\n${OT_COLOR_SKIP}SKIP${OT_COLOR_NONE} ${script}"
455 echo -e "\n${OT_COLOR_FAIL}FAIL${OT_COLOR_NONE} ${script}"
460 echo -e "\n${OT_COLOR_PASS}PASS${OT_COLOR_NONE} ${script}"
473 test_patterns=(-name 'tun-*.exp')
475 test_patterns=(-name 'posix-*.exp' -o -name 'cli-*.exp')
477 test_patterns+=(-o -name 'v1_2-*.exp')
481 test_patterns=(-name 'cli-*.exp' -o -name 'simulation-*.exp' -o -name 'cli_non_rcp-*.exp')
488 export -f ot_exec_expect_script
490 …s/scripts/expect -type f -perm "$([[ $OSTYPE == darwin* ]] && echo '+' || echo '/')"111 \( "${test…
502 'rcp' or 'rcp-cli' for CLI on POSIX platform.
503 'rcp-ncp' for NCP on POSIX platform.
506 …OT_BUILDDIR The output directory for cmake build. By default the directory is './build'. For e…
507 'OT_BUILDDIR=\${PWD}/my_awesome_build ./script/test clean build'.
508 VERBOSE 1 to build or test verbosely. The default is 0.
512 … INTER_OP 1 to build 1.1 together. Only works when THREAD_VERSION is 1.4. The default is 0.
513 …INTER_OP_BBR 1 to build bbr version together. Only works when THREAD_VERSION is 1.4. The defaul…
516 clean Clean built files to prepare for new build.
517build Build project for running tests. This can be used to rebuild the project for chang…
518 …cert Run a single thread-cert test. ENVIRONMENTS should be the same as those given to b…
519 …cert_suite Run a batch of thread-cert tests and summarize the test results. Only echo logs fo…
526 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
527 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
530 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
531 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
534 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
535 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
538 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
539 VIRTUAL_TIME=0 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
542 …THREAD_VERSION=1.1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_Router…
543 …THREAD_VERSION=1.1 VIRTUAL_TIME=0 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeou…
546 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py
547 INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_router_5_1_1.py
548 INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert_suite tests/scripts/thread-cert/v1_2_*
551 $0 clean build expect tests/scripts/expect/cli-log-level.exp
554 $0 clean build expect
562 echo "$OT_COREDUMP_DIR/corefile-%e-%p-%t" | sudo tee /proc/sys/kernel/core_pattern
563 rm -rf "$OT_COREDUMP_DIR"
564 mkdir -p "$OT_COREDUMP_DIR"
569 mkdir -p "$OT_COREDUMP_DIR/so-lib"
570 cp /lib/x86_64-linux-gnu/libgcc_s.so.1 "$OT_COREDUMP_DIR/so-lib"
571 cp /lib/x86_64-linux-gnu/libc.so.6 "$OT_COREDUMP_DIR/so-lib"
572 cp /lib64/ld-linux-x86-64.so.2 "$OT_COREDUMP_DIR/so-lib"
577 shopt -s nullglob
580 declare -A bin_list=([dummy]='')
582 bin=$(file "$f" | grep -E -o "execfn: '(.*')," | sed -r "s/execfn: '(.*)',/\1/")
590 if [[ $key =~ openthread-(simulation|posix)-([0-9]\.[0-9]) ]]; then
591 … postfix="-$(echo "$key" | sed -r "s/.*openthread-(simulation|posix)-([0-9]\.[0-9]).*/\2/")"
599 [[ ${#bin_list[@]} -gt 1 ]] && (
607 mkdir -p tmp/
609 rm -f tmp/coverage.lcov
612 llvm_gcov="$(mktemp -d)/llvm-gcov"
614 echo 'exec llvm-cov gcov "$@"' >>"$llvm_gcov"
616 lcov --gcov-tool "$llvm_gcov" --directory . --capture --output-file tmp/coverage.info
618 ./script/gcda-tool collect
619 ./script/gcda-tool install
621 lcov --directory . --capture --output-file tmp/coverage.info
623 lcov --list tmp/coverage.info
624 lcov --extract tmp/coverage.info "$PWD/src/core/common/message.cpp" | c++filt
629 ls -R coverage/
631 readarray -d '' files < <(find coverage/ -type f -name 'coverage*.info' -print0)
635 args+=('-a')
638 lcov "${args[@]}" -o final.info
646 …export RADIO_DEVICE="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}/examples/apps/ncp/ot-r…
647 export OT_CLI_PATH="${OT_BUILDDIR}/openthread-posix-${THREAD_VERSION}/src/posix/ot-cli"
650 … export RADIO_DEVICE_1_1="${OT_BUILDDIR}/openthread-simulation-1.1/examples/apps/ncp/ot-rcp"
651 export OT_CLI_PATH_1_1="${OT_BUILDDIR}/openthread-posix-1.1/src/posix/ot-cli"
652 export OT_CLI_PATH_BBR="${OT_BUILDDIR}/openthread-posix-1.4-bbr/src/posix/ot-cli"
656 export OT_SIMULATION_APPS="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}/examples/apps"
657 export OT_POSIX_APPS="${OT_BUILDDIR}/openthread-posix-${THREAD_VERSION}/src/posix"
677 export -n VERBOSE
681 read -r -a ot_extra_options <<<"${OT_OPTIONS}"
691 if [[ -z ${1-} ]]; then
703 build)
752 echo -e "${OT_COLOR_FAIL}Warning:${OT_COLOR_NONE} Ignoring: '$1'"