unit test build times (#3489)

* don't emit assembly listings

* more

* extract coverage

* link coverage
This commit is contained in:
Matthew Kennedy 2021-11-06 18:20:24 -07:00 committed by GitHub
parent 3f278e989b
commit 8124c2a12d
3 changed files with 15 additions and 9 deletions

View File

@ -52,7 +52,7 @@ jobs:
- name: Build Tests - name: Build Tests
working-directory: ./unit_tests/ working-directory: ./unit_tests/
run: make -j4 run: make -j4 COVERAGE=yes
- name: Run Tests - name: Run Tests
working-directory: ./unit_tests/ working-directory: ./unit_tests/

View File

@ -65,18 +65,18 @@ endif
ifeq ($(IS_MAC),yes) ifeq ($(IS_MAC),yes)
ODFLAGS = -x --syms ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS) ASFLAGS = $(MCFLAGS) -Wa $(ADEFS)
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS) ASXFLAGS = $(MCFLAGS) -Wa $(ADEFS)
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) $(DEFS) CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) $(DEFS)
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) $(DEFS) CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) $(DEFS)
LDFLAGS = $(MCFLAGS) $(LLIBDIR) LDFLAGS = $(MCFLAGS) $(LLIBDIR)
else else
# not mac # not mac
ODFLAGS = -x --syms ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS) ASFLAGS = $(MCFLAGS) $(ADEFS)
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS) ASXFLAGS = $(MCFLAGS) $(ADEFS)
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS) CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) $(DEFS)
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS) CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) $(DEFS)
ifeq ($(USE_LINK_GC),yes) ifeq ($(USE_LINK_GC),yes)
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR) LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
else else

View File

@ -18,10 +18,13 @@ ifeq ($(USE_OPT),)
# -O2 is needed for mingw, without it there is a linking issue to isnanf?!?! # -O2 is needed for mingw, without it there is a linking issue to isnanf?!?!
#USE_OPT = $(RFLAGS) -O2 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers #USE_OPT = $(RFLAGS) -O2 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers
USE_OPT = -c -Wall -O0 -ggdb -g USE_OPT = -c -Wall -O0 -ggdb -g
USE_OPT += -fprofile-arcs -ftest-coverage
USE_OPT += -Werror=missing-field-initializers USE_OPT += -Werror=missing-field-initializers
endif endif
ifeq ($(COVERAGE),yes)
USE_OPT += -fprofile-arcs -ftest-coverage
endif
#TODO! this is a nice goal #TODO! this is a nice goal
#USE_OPT += $(RUSEFI_OPT) #USE_OPT += $(RUSEFI_OPT)
@ -180,7 +183,10 @@ ULIBDIR =
# List all user libraries here # List all user libraries here
ULIBS = -lm ULIBS = -lm
ULIBS += --coverage
ifeq ($(COVERAGE),yes)
ULIBS += --coverage
endif
ifneq ($(OS),Windows_NT) ifneq ($(OS),Windows_NT)
ULIBS += -fsanitize=address ULIBS += -fsanitize=address