提交 185fb493 编写于 作者: J jsalling

Cleanup example Makefiles, update test runners

Delete clang flags that were disabled with -Wno-*
上级 d460a89a
......@@ -5,17 +5,14 @@
# ==========================================
#We try to detect the OS we are running on, and adjust commands as needed
ifeq ($(OSTYPE),cygwin)
CLEANUP = rm -f
MKDIR = mkdir -p
TARGET_EXTENSION=.out
elseifeq ($(OSTYPE),msys)
CLEANUP = rm -f
MKDIR = mkdir -p
TARGET_EXTENSION=.exe
elseifeq ($(OS),Windows_NT)
ifeq ($(OS),Windows_NT)
ifeq ($(shell uname -s),) # not in a bash-like shell
CLEANUP = del /F /Q
MKDIR = mkdir
else # in a bash-like shell, like msys
CLEANUP = rm -f
MKDIR = mkdir -p
endif
TARGET_EXTENSION=.exe
else
CLEANUP = rm -f
......@@ -23,8 +20,12 @@ else
TARGET_EXTENSION=.out
endif
UNITY_ROOT=../..
C_COMPILER=gcc
ifeq ($(shell uname -s), Darwin)
C_COMPILER=clang
endif
UNITY_ROOT=../..
CFLAGS=-std=c89
CFLAGS += -Wall
......@@ -48,7 +49,7 @@ TARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION)
SRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c
SRC_FILES2=$(UNITY_ROOT)/src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
INC_DIRS=-Isrc -I$(UNITY_ROOT)/src
SYMBOLS=-DTEST
SYMBOLS=
all: clean default
......
......@@ -11,7 +11,7 @@
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
if (TEST_PROTECT()) \
{ \
tearDown(); \
} \
......
......@@ -11,7 +11,7 @@
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
if (TEST_PROTECT()) \
{ \
tearDown(); \
} \
......
......@@ -5,17 +5,14 @@
# ==========================================
#We try to detect the OS we are running on, and adjust commands as needed
ifeq ($(OSTYPE),cygwin)
CLEANUP = rm -f
MKDIR = mkdir -p
TARGET_EXTENSION=.out
elseifeq ($(OSTYPE),msys)
CLEANUP = rm -f
MKDIR = mkdir -p
TARGET_EXTENSION=.exe
elseifeq ($(OS),Windows_NT)
ifeq ($(OS),Windows_NT)
ifeq ($(shell uname -s),) # not in a bash-like shell
CLEANUP = del /F /Q
MKDIR = mkdir
else # in a bash-like shell, like msys
CLEANUP = rm -f
MKDIR = mkdir -p
endif
TARGET_EXTENSION=.exe
else
CLEANUP = rm -f
......@@ -23,13 +20,16 @@ else
TARGET_EXTENSION=.out
endif
UNITY_ROOT=../..
C_COMPILER=gcc
ifeq ($(shell uname -s), Darwin)
C_COMPILER=clang
endif
UNITY_ROOT=../..
CFLAGS = -std=c99
CFLAGS=-std=c99
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += -Wpointer-arith
CFLAGS += -Wcast-align
CFLAGS += -Wwrite-strings
......@@ -41,8 +41,6 @@ CFLAGS += -Wno-unknown-pragmas
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef
CFLAGS += -Wold-style-definition
CFLAGS += -Wmissing-prototypes
CFLAGS += -Wmissing-declarations
TARGET_BASE1=all_tests
TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
......@@ -63,8 +61,8 @@ all: clean default
default:
$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1)
./$(TARGET1) -v
- ./$(TARGET1) -v
clean:
$(CLEANUP)
$(CLEANUP) $(TARGET1)
......@@ -16,13 +16,10 @@ compiler:
- '-Winit-self'
- '-Winline'
- '-Winvalid-pch'
- '-Wmissing-declarations'
- '-Wmissing-include-dirs'
- '-Wmissing-prototypes'
- '-Wnonnull'
- '-Wpacked'
- '-Wpointer-arith'
- '-Wredundant-decls'
- '-Wswitch-default'
- '-Wstrict-aliasing'
- '-Wstrict-overflow=5'
......@@ -33,10 +30,7 @@ compiler:
- '-Wshadow'
- '-Wundef'
- '-Wwrite-strings'
- '-Wno-missing-declarations'
- '-Wno-missing-prototypes'
- '-Wno-nested-externs'
- '-Wno-redundant-decls'
- '-Wno-unused-parameter'
- '-Wno-variadic-macros'
- '-Wbad-function-cast'
......
......@@ -16,13 +16,10 @@ compiler:
- '-Winit-self'
- '-Winline'
- '-Winvalid-pch'
- '-Wmissing-declarations'
- '-Wmissing-include-dirs'
- '-Wmissing-prototypes'
- '-Wnonnull'
- '-Wpacked'
- '-Wpointer-arith'
- '-Wredundant-decls'
- '-Wswitch-default'
- '-Wstrict-aliasing'
- '-Wstrict-overflow=5'
......@@ -33,10 +30,7 @@ compiler:
- '-Wshadow'
- '-Wundef'
- '-Wwrite-strings'
- '-Wno-missing-declarations'
- '-Wno-missing-prototypes'
- '-Wno-nested-externs'
- '-Wno-redundant-decls'
- '-Wno-unused-parameter'
- '-Wno-variadic-macros'
- '-Wbad-function-cast'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册