unit tests in clang (#2012)
* clang errors * non-test-only * debugging * rules on mac * makefile * put back * let's see if this way makes everybody happy * no, it does nto Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
c492d5b6af
commit
e544e8150a
|
@ -2,6 +2,7 @@
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"marus25.cortex-debug",
|
"marus25.cortex-debug",
|
||||||
"Gruntfuggly.todo-tree",
|
"Gruntfuggly.todo-tree",
|
||||||
"ms-vscode.cpptools"
|
"ms-vscode.cpptools",
|
||||||
|
"vadimcn.vscode-lldb"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Debug Unit Tests",
|
"name": "Debug Unit Tests (gdb)",
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/unit_tests/build/rusefi_test",
|
"program": "${workspaceFolder}/unit_tests/build/rusefi_test",
|
||||||
|
@ -24,6 +24,14 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug Unit Tests (lldb)",
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/unit_tests/build/rusefi_test",
|
||||||
|
"args": [],
|
||||||
|
"cwd": "${workspaceFolder}/unit_tests/build/",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Debug F40x",
|
"name": "Debug F40x",
|
||||||
"type": "cortex-debug",
|
"type": "cortex-debug",
|
||||||
|
|
|
@ -18,16 +18,12 @@ include $(PROJECT_DIR)/rusefi_rules.mk
|
||||||
|
|
||||||
# Compiler options here.
|
# Compiler options here.
|
||||||
ifeq ($(USE_OPT),)
|
ifeq ($(USE_OPT),)
|
||||||
# As of Jan 2016 we are producing 64 bit unit tests on Windows which needs 64 bit GDB
|
|
||||||
# Previouslyt we had to download 32 bit version of GDB maybe from http://www.equation.com/servlet/equation.cmd?fa=gdb
|
|
||||||
#
|
|
||||||
# -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 -g3
|
USE_OPT = -c -Wall -O0 -ggdb -g3
|
||||||
USE_OPT += -fprofile-arcs -ftest-coverage
|
USE_OPT += -fprofile-arcs -ftest-coverage
|
||||||
USE_OPT += -Werror=missing-field-initializers
|
USE_OPT += -Werror=missing-field-initializers
|
||||||
USE_OPT += -Wno-unused-parameter -Wno-unused-function
|
USE_OPT += -Wno-unused-parameter -Wno-unused-function
|
||||||
USE_OPT += -fsingle-precision-constant
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -297,7 +293,7 @@ ULIBDIR =
|
||||||
|
|
||||||
# List all user libraries here
|
# List all user libraries here
|
||||||
ULIBS = -lm
|
ULIBS = -lm
|
||||||
ULIBS += -lgcov --coverage
|
ULIBS += --coverage
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of user defines
|
# End of user defines
|
||||||
|
|
|
@ -54,16 +54,33 @@ ADEFS = $(DADEFS) $(UADEFS)
|
||||||
LIBS = $(DLIBS) $(ULIBS)
|
LIBS = $(DLIBS) $(ULIBS)
|
||||||
|
|
||||||
# Various settings
|
# Various settings
|
||||||
#MCFLAGS = -mcpu=$(MCU)
|
IS_MAC = no
|
||||||
ODFLAGS = -x --syms
|
ifneq ($(OS),Windows_NT)
|
||||||
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
UNAME_S := $(shell uname -s)
|
||||||
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
|
IS_MAC = yes
|
||||||
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
|
endif
|
||||||
ifeq ($(USE_LINK_GC),yes)
|
endif
|
||||||
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
|
|
||||||
|
ifeq ($(IS_MAC),yes)
|
||||||
|
ODFLAGS = -x --syms
|
||||||
|
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
||||||
|
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
|
||||||
|
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) $(DEFS)
|
||||||
|
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) $(DEFS)
|
||||||
|
LDFLAGS = $(MCFLAGS) $(LLIBDIR)
|
||||||
else
|
else
|
||||||
|
# not mac
|
||||||
|
ODFLAGS = -x --syms
|
||||||
|
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
||||||
|
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
|
||||||
|
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
|
||||||
|
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
|
||||||
|
ifeq ($(USE_LINK_GC),yes)
|
||||||
|
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
|
||||||
|
else
|
||||||
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR)
|
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Generate dependency information
|
# Generate dependency information
|
||||||
|
|
Loading…
Reference in New Issue