8000 coverage: Enable format checking in coverage build. · micropython/micropython@536f6fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 536f6fb

Browse files
committed
coverage: Enable format checking in coverage build.
Signed-off-by: Jeff Epler <jepler@gmail.com>
1 parent 1c97e4d commit 536f6fb

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

ports/unix/variants/coverage/mpconfigvariant.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Disable optimisations and enable assert() on coverage builds.
22
DEBUG ?= 1
33

4+
ifneq ($(DISABLE_PLUGIN),1)
5+
# Enable format string checking
6+
include $(TOP)/py/fmtplugin.mk
7+
endif
8+
49
CFLAGS += \
510
-fprofile-arcs -ftest-coverage \
611
-Wformat -Wmissing-declarations -Wmissing-prototypes \

tools/ci.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ function ci_unix_coverage_setup {
622622
sudo pip3 install setuptools
623623
sudo pip3 install pyelftools
624624
sudo pip3 install ar
625+
GCC_VER=$(echo __GNUC__ | gcc -P -E -)
626+
sudo apt-get install gcc-${GCC_VER}-plugin-dev
625627
gcc --version
626628
python3 --version
627629
}
@@ -664,10 +666,18 @@ function ci_unix_coverage_run_native_mpy_tests {
664666
(cd tests && ./run-natmodtests.py "$@" extmod/*.py)
665667
}
666668

669+
function ci_gcc_plugin_setup_helper {
670+
GCC_VER=$(echo __GNUC__ | ${1}-gcc -P -E -)
671+
sudo apt-get install gcc-${GCC_VER}-plugin-dev-${1}
672+
}
673+
667674
function ci_unix_32bit_setup {
668675
sudo dpkg --add-architecture i386
669676
sudo apt-get update
677+
GCC_VER=$(echo __GNUC__ | gcc -P -E -)
670678
sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 python2.7
679+
GCC_VER=$(echo __GNUC__ | gcc -P -E -)
680+
sudo apt-get install gcc-${GCC_VER}-plugin-dev
671681
sudo pip3 install setuptools
672682
sudo pip3 install pyelftools
673683
sudo pip3 install ar
@@ -782,8 +792,8 @@ function ci_unix_macos_build {
782792
#make ${MAKEOPTS} -C ports/unix deplibs
783793
make ${MAKEOPTS} -C ports/unix
784794
# check for additional compiler errors/warnings
785-
make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules
786-
make ${MAKEOPTS} -C ports/unix VARIANT=coverage
795+
make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules DISABLE_PLUGIN=1
796+
make ${MAKEOPTS} -C ports/unix VARIANT=coverage DISABLE_PLUGIN=1
787797
}
788798

789799
function ci_unix_macos_run_tests {
@@ -795,8 +805,9 @@ function ci_unix_macos_run_tests {
795805

796806
function ci_unix_qemu_mips_setup {
797807
sudo apt-get update
798-
sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
808+
sudo apt-get install gcc-10-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
799809
sudo apt-get install qemu-user
810+
ci_gcc_plugin_setup_helper mips-linux-gnu
800811
qemu-mips --version
801812
sudo mkdir /etc/qemu-binfmt
802813
sudo ln -s /usr/mips-linux-gnu/ /etc/qemu-binfmt/mips
@@ -816,6 +827,7 @@ function ci_unix_qemu_arm_setup {
816827
sudo apt-get update
817828
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
818829
sudo apt-get install qemu-user
830+
ci_gcc_plugin_setup_helper arm-linux-gnueabi
819831
qemu-arm --version
820832
sudo mkdir /etc/qemu-binfmt
821833
sudo ln -s /usr/arm-linux-gnueabi/ /etc/qemu-binfmt/arm
@@ -837,6 +849,7 @@ function ci_unix_qemu_riscv64_setup {
837849
sudo apt-get update
838850
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
839851
sudo apt-get install qemu-user
852+
ci_gcc_plugin_setup_helper riscv64-linux-gnu
840853
qemu-riscv64 --version
841854
sudo mkdir /etc/qemu-binfmt
842855
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64

0 commit comments

Comments
 (0)
0