Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
ff03e1c9
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
大约 1 年 前同步成功
通知
33
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff03e1c9
编写于
1月 23, 2017
作者:
M
Mark VanderVoord
提交者:
GitHub
1月 23, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #252 from jsalling/feature/compile-examples
Compile examples during continuous integration
上级
a15f0da0
e0104179
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
55 addition
and
62 deletion
+55
-62
.gitignore
.gitignore
+3
-4
.travis.yml
.travis.yml
+5
-0
examples/example_1/makefile
examples/example_1/makefile
+22
-17
examples/example_1/test/test_runners/TestProductionCode2_Runner.c
.../example_1/test/test_runners/TestProductionCode2_Runner.c
+1
-1
examples/example_1/test/test_runners/TestProductionCode_Runner.c
...s/example_1/test/test_runners/TestProductionCode_Runner.c
+1
-1
examples/example_2/makefile
examples/example_2/makefile
+16
-16
examples/example_3/rakefile_helper.rb
examples/example_3/rakefile_helper.rb
+3
-1
examples/example_3/readme.txt
examples/example_3/readme.txt
+4
-10
test/targets/clang_file.yml
test/targets/clang_file.yml
+0
-6
test/targets/clang_strict.yml
test/targets/clang_strict.yml
+0
-6
未找到文件。
.gitignore
浏览文件 @
ff03e1c9
build/
test/sandbox
.DS_Store
examples/example_1/test1.exe
examples/example_1/test2.exe
examples/example_2/all_tests.exe
examples/example_1/test1.out
examples/example_1/test2.out
examples/example_2/all_tests.out
examples/example_3/test1.out
examples/example_3/test2.out
test/testparameterized.c.results
test/testunity.c.results
.travis.yml
浏览文件 @
ff03e1c9
...
...
@@ -11,10 +11,15 @@ matrix:
before_install
:
-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then rvm install 2.1 && rvm use 2.1 && ruby -v; fi
-
if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install --assume-yes --quiet gcc-multilib; fi
install
:
gem install rspec
script
:
-
cd test && rake ci
-
make -s
-
make -s DEBUG=-m32
-
cd ../extras/fixture/test && rake ci
-
make -s default noStdlibMalloc
-
make -s C89
-
cd ../../../examples/example_1 && make -s ci
-
cd ../example_2 && make -s ci
-
cd ../example_3 && rake
examples/example_1/makefile
浏览文件 @
ff03e1c9
...
...
@@ -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
else
ifeq
($(OSTYPE),msys)
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.exe
else
ifeq
($(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
=
c89
CFLAGS
+=
-Wall
CFLAGS
+=
-Wextra
CFLAGS
+=
-Werror
CFLAGS
+=
-Wpointer-arith
CFLAGS
+=
-Wcast-align
CFLAGS
+=
-Wwrite-strings
...
...
@@ -49,18 +49,23 @@ 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
default
:
ruby
$(UNITY_ROOT)
/auto/generate_test_runner.rb
test
/TestProductionCode.c
test
/test_runners/TestProductionCode_Runner.c
ruby
$(UNITY_ROOT)
/auto/generate_test_runner.rb
test
/TestProductionCode2.c
test
/test_runners/TestProductionCode2_Runner.c
default
:
$(SRC_FILES1) $(SRC_FILES2)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES2)
-o
$(TARGET2)
./
$(TARGET1)
-
./
$(TARGET1)
./
$(TARGET2)
test/test_runners/TestProductionCode_Runner.c
:
test/TestProductionCode.c
ruby
$(UNITY_ROOT)
/auto/generate_test_runner.rb
test
/TestProductionCode.c
test
/test_runners/TestProductionCode_Runner.c
test/test_runners/TestProductionCode2_Runner.c
:
test/TestProductionCode2.c
ruby
$(UNITY_ROOT)
/auto/generate_test_runner.rb
test
/TestProductionCode2.c
test
/test_runners/TestProductionCode2_Runner.c
clean
:
$(CLEANUP)
$(CLEANUP)
$(TARGET1)
$(TARGET2)
ci
:
CFLAGS += -Werror
ci
:
default
examples/example_1/test/test_runners/TestProductionCode2_Runner.c
浏览文件 @
ff03e1c9
...
...
@@ -11,7 +11,7 @@
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT()
&& !TEST_IS_IGNORED
) \
if (TEST_PROTECT()) \
{ \
tearDown(); \
} \
...
...
examples/example_1/test/test_runners/TestProductionCode_Runner.c
浏览文件 @
ff03e1c9
...
...
@@ -11,7 +11,7 @@
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT()
&& !TEST_IS_IGNORED
) \
if (TEST_PROTECT()) \
{ \
tearDown(); \
} \
...
...
examples/example_2/makefile
浏览文件 @
ff03e1c9
...
...
@@ -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
else
ifeq
($(OSTYPE),msys)
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.exe
else
ifeq
($(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,10 @@ all: clean default
default
:
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
./
$(TARGET1)
-v
-
./
$(TARGET1)
-v
clean
:
$(CLEANUP)
$(CLEANUP)
$(TARGET1)
ci
:
CFLAGS += -Werror
ci
:
default
examples/example_3/rakefile_helper.rb
浏览文件 @
ff03e1c9
...
...
@@ -251,6 +251,8 @@ module RakefileHelpers
def
fail_out
(
msg
)
puts
msg
exit
(
-
1
)
puts
"Not returning exit code so continuous integration can pass"
# exit(-1) # Only removed to pass example_3, which has failing tests on purpose.
# Still fail if the build fails for any other reason.
end
end
examples/example_3/readme.txt
浏览文件 @
ff03e1c9
...
...
@@ -4,16 +4,10 @@ Example 3
This example project gives an example of some passing, ignored, and failing tests.
It's simple and meant for you to look over and get an idea for what all of this stuff does.
You can build and test using the makefile if you have gcc installed (you may need to tweak
the locations of some tools in the makefile). Otherwise, the rake version will let you
test with gcc or a couple versions of IAR. You can tweak the yaml files to get those versions
running.
You can build and test using rake. The rake version will let you test with gcc or a couple
versions of IAR. You can tweak the yaml files to get those versions running.
Ruby is required if you're using the rake version (obviously). This version shows off most of
Unity's advanced features (automatically creating test runners, fancy summaries, etc.)
The makefile version doesn't require anything outside of your normal build tools, but won't do the
extras for you. So that you can test right away, we've written the test runners for you and
put them in the test\no_ruby subdirectory. If you make changes to the tests or source, you might
need to update these (like when you add or remove tests). Do that for a while and you'll learn
why you really want to start using the Ruby tools.
\ No newline at end of file
Without ruby, you have to maintain your own test runners. Do that for a while and you'll learn
why you really want to start using the Ruby tools.
test/targets/clang_file.yml
浏览文件 @
ff03e1c9
...
...
@@ -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'
...
...
test/targets/clang_strict.yml
浏览文件 @
ff03e1c9
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录