Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ports_unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
run: source tools/ci.sh && ci_unix_coverage_run_native_mpy_tests
- name: Run gcov coverage analysis
run: |
(cd mpy-cross && gcov -o build/py ../py/*.c || true)
(cd ports/unix && gcov -o build-coverage/py ../../py/*.c || true)
(cd ports/unix && gcov -o build-coverage/extmod ../../extmod/*.c || true)
- name: Upload coverage to Codecov
Expand Down
16 changes: 10 additions & 6 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,14 @@ CI_UNIX_OPTS_QEMU_RISCV64=(

CI_UNIX_OPTS_SANITIZE_ADDRESS=(
# Macro MP_ASAN allows detecting ASan on gcc<=13
CFLAGS_EXTRA="-fsanitize=address --param asan-use-after-return=0 -DMP_ASAN=1"
LDFLAGS_EXTRA="-fsanitize=address --param asan-use-after-return=0"
CFLAGS_EXTRA="-fsanitize=address --param asan-use-after-return=0 -fno-sanitize-recover -DMP_ASAN=1"
LDFLAGS_EXTRA="-fsanitize=address --param asan-use-after-return=0 -fno-sanitize-recover"
)

CI_UNIX_OPTS_SANITIZE_UNDEFINED=(
# Macro MP_UBSAN allows detecting UBSan on gcc<=13
CFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute -DMP_UBSAN=1"
LDFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute"
CFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute -fno-sanitize-recover -DMP_UBSAN=1"
LDFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute -fno-sanitize-recover"
)

function ci_unix_build_helper {
Expand Down Expand Up @@ -637,6 +637,10 @@ function ci_unix_coverage_setup {
}

function ci_unix_coverage_build {
make ${MAKEOPTS} -C mpy-cross COPT="-Os -fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs -ftest-coverage -lm" DEBUG=1
make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules
make ${MAKEOPTS} -C ports/unix VARIANT=coverage deplibs
make ${MAKEOPTS} -C ports/unix VARIANT=coverage
ci_unix_build_helper VARIANT=coverage
ci_unix_build_ffi_lib_helper gcc
}
Expand Down Expand Up @@ -774,7 +778,7 @@ function ci_unix_settrace_stackless_run_tests {
}

function ci_unix_sanitize_undefined_build {
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C mpy-cross "${CI_UNIX_OPTS_SANITIZE_UNDEFINED[@]}"
make ${MAKEOPTS} -C ports/unix submodules
make ${MAKEOPTS} -C ports/unix VARIANT=coverage "${CI_UNIX_OPTS_SANITIZE_UNDEFINED[@]}"
ci_unix_build_ffi_lib_helper gcc
Expand All @@ -785,7 +789,7 @@ function ci_unix_sanitize_undefined_run_tests {
}

function ci_unix_sanitize_address_build {
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C mpy-cross "${CI_UNIX_OPTS_SANITIZE_ADDRESS[@]}"
make ${MAKEOPTS} -C ports/unix submodules
make ${MAKEOPTS} -C ports/unix VARIANT=coverage "${CI_UNIX_OPTS_SANITIZE_ADDRESS[@]}"
ci_unix_build_ffi_lib_helper gcc
Expand Down
Loading