Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
06c95fcb
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
1 年多 前同步成功
通知
36
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看板
提交
06c95fcb
编写于
6月 18, 2015
作者:
T
ThingamaByte, LLC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Fixed broken examples
上级
b922d622
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
122 addition
and
208 deletion
+122
-208
examples/example_1/makefile
examples/example_1/makefile
+7
-3
examples/example_1/test/test_runners/TestProductionCode2_Runner.c
.../example_1/test/test_runners/TestProductionCode2_Runner.c
+53
-33
examples/example_1/test/test_runners/TestProductionCode_Runner.c
...s/example_1/test/test_runners/TestProductionCode_Runner.c
+57
-37
examples/example_2/makefile
examples/example_2/makefile
+5
-3
examples/example_3/makefile
examples/example_3/makefile
+0
-62
examples/example_3/test/no_ruby/TestProductionCode2_Runner.c
examples/example_3/test/no_ruby/TestProductionCode2_Runner.c
+0
-33
examples/example_3/test/no_ruby/TestProductionCode_Runner.c
examples/example_3/test/no_ruby/TestProductionCode_Runner.c
+0
-37
未找到文件。
examples/example_1/makefile
浏览文件 @
06c95fcb
...
@@ -9,7 +9,11 @@ ifeq ($(OSTYPE),cygwin)
...
@@ -9,7 +9,11 @@ ifeq ($(OSTYPE),cygwin)
CLEANUP
=
rm
-f
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.out
TARGET_EXTENSION
=
.out
else
ifeq
($(OS),Windows_NT)
else
ifeq
($(OSTYPE),msys)
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.exe
else
ifeq
($(OS),Windows_NT)
CLEANUP
=
del /F /Q
CLEANUP
=
del /F /Q
MKDIR
=
mkdir
MKDIR
=
mkdir
TARGET_EXTENSION
=
.exe
TARGET_EXTENSION
=
.exe
...
@@ -50,8 +54,8 @@ SYMBOLS=-DTEST
...
@@ -50,8 +54,8 @@ SYMBOLS=-DTEST
all
:
clean default
all
:
clean default
default
:
default
:
# ruby
auto/generate_test_runner.rb test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c
ruby
$(UNITY_ROOT)
/
auto/generate_test_runner.rb
test
/TestProductionCode.c
test
/test_runners/TestProductionCode_Runner.c
# ruby
auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
ruby
$(UNITY_ROOT)
/
auto/generate_test_runner.rb
test
/TestProductionCode2.c
test
/test_runners/TestProductionCode2_Runner.c
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES2)
-o
$(TARGET2)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES2)
-o
$(TARGET2)
./
$(TARGET1)
./
$(TARGET1)
...
...
examples/example_1/test/test_runners/TestProductionCode2_Runner.c
浏览文件 @
06c95fcb
/* AUTOGENERATED FILE. DO NOT EDIT. */
/* AUTOGENERATED FILE. DO NOT EDIT. */
#include "unity.h"
#include <setjmp.h>
//=======Test Runner Used To Run Each Test Below=====
#include <stdio.h>
#define RUN_TEST(TestFunc, TestLineNum) \
{
\
char
MessageBuffer
[
50
];
Unity
.
CurrentTestName
=
#
TestFunc
;
\
Unity
.
CurrentTestLineNumber
=
TestLineNum
;
\
extern
void
setUp
(
void
);
Unity
.
NumberOfTests
++
;
\
extern
void
tearDown
(
void
);
if
(
TEST_PROTECT
())
\
{
\
extern
void
test_IgnoredTest
(
void
);
setUp
();
\
extern
void
test_AnotherIgnoredTest
(
void
);
TestFunc
();
\
extern
void
test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented
(
void
);
}
\
if
(
TEST_PROTECT
()
&&
!
TEST_IS_IGNORED
)
\
void
resetTest
(
void
);
{
\
void
resetTest
(
void
)
tearDown
();
\
{
}
\
tearDown
();
UnityConcludeTest
();
\
setUp
();
}
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
int
main
(
void
)
#include <setjmp.h>
{
#include <stdio.h>
UnityBegin
(
"test/TestProductionCode2.c"
);
#include "ProductionCode2.h"
RUN_TEST
(
test_IgnoredTest
,
13
);
//=======External Functions This Runner Calls=====
RUN_TEST
(
test_AnotherIgnoredTest
,
18
);
extern
void
setUp
(
void
);
RUN_TEST
(
test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented
,
23
);
extern
void
tearDown
(
void
);
extern
void
test_IgnoredTest
(
void
);
UnityEnd
();
extern
void
test_AnotherIgnoredTest
(
void
);
return
0
;
extern
void
test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented
(
void
);
}
//=======Test Reset Option=====
void
resetTest
(
void
);
void
resetTest
(
void
)
{
tearDown
();
setUp
();
}
//=======MAIN=====
int
main
(
void
)
{
UnityBegin
(
"test/TestProductionCode2.c"
);
RUN_TEST
(
test_IgnoredTest
,
18
);
RUN_TEST
(
test_AnotherIgnoredTest
,
23
);
RUN_TEST
(
test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented
,
28
);
return
(
UnityEnd
());
}
examples/example_1/test/test_runners/TestProductionCode_Runner.c
浏览文件 @
06c95fcb
/* AUTOGENERATED FILE. DO NOT EDIT. */
/* AUTOGENERATED FILE. DO NOT EDIT. */
#include "unity.h"
#include <setjmp.h>
//=======Test Runner Used To Run Each Test Below=====
#include <stdio.h>
#define RUN_TEST(TestFunc, TestLineNum) \
{
\
char
MessageBuffer
[
50
];
Unity
.
CurrentTestName
=
#
TestFunc
;
\
Unity
.
CurrentTestLineNumber
=
TestLineNum
;
\
extern
void
setUp
(
void
);
Unity
.
NumberOfTests
++
;
\
extern
void
tearDown
(
void
);
if
(
TEST_PROTECT
())
\
{
\
extern
void
test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode
(
void
);
setUp
();
\
extern
void
test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken
(
void
);
TestFunc
();
\
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue
(
void
);
}
\
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain
(
void
);
if
(
TEST_PROTECT
()
&&
!
TEST_IS_IGNORED
)
\
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed
(
void
);
{
\
tearDown
();
\
void
resetTest
(
void
);
}
\
void
resetTest
(
void
)
UnityConcludeTest
();
\
{
}
tearDown
();
setUp
();
//=======Automagically Detected Files To Include=====
}
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
int
main
(
void
)
#include "ProductionCode.h"
{
UnityBegin
(
"test/TestProductionCode.c"
);
//=======External Functions This Runner Calls=====
extern
void
setUp
(
void
);
RUN_TEST
(
test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode
,
20
);
extern
void
tearDown
(
void
);
RUN_TEST
(
test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken
,
30
);
extern
void
test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode
(
void
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue
,
41
);
extern
void
test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken
(
void
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain
,
51
);
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue
(
void
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed
,
57
);
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain
(
void
);
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed
(
void
);
UnityEnd
();
return
0
;
}
//=======Test Reset Option=====
void
resetTest
(
void
);
void
resetTest
(
void
)
{
tearDown
();
setUp
();
}
//=======MAIN=====
int
main
(
void
)
{
UnityBegin
(
"test/TestProductionCode.c"
);
RUN_TEST
(
test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode
,
20
);
RUN_TEST
(
test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken
,
30
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue
,
41
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain
,
51
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed
,
57
);
return
(
UnityEnd
());
}
examples/example_2/makefile
浏览文件 @
06c95fcb
...
@@ -9,7 +9,11 @@ ifeq ($(OSTYPE),cygwin)
...
@@ -9,7 +9,11 @@ ifeq ($(OSTYPE),cygwin)
CLEANUP
=
rm
-f
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.out
TARGET_EXTENSION
=
.out
else
ifeq
($(OS),Windows_NT)
else
ifeq
($(OSTYPE),msys)
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.exe
else
ifeq
($(OS),Windows_NT)
CLEANUP
=
del /F /Q
CLEANUP
=
del /F /Q
MKDIR
=
mkdir
MKDIR
=
mkdir
TARGET_EXTENSION
=
.exe
TARGET_EXTENSION
=
.exe
...
@@ -58,8 +62,6 @@ SYMBOLS=
...
@@ -58,8 +62,6 @@ SYMBOLS=
all
:
clean default
all
:
clean default
default
:
default
:
# ruby auto/generate_test_runner.rb test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c
# ruby auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
./
$(TARGET1)
./
$(TARGET1)
...
...
examples/example_3/makefile
已删除
100644 → 0
浏览文件 @
b922d622
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
#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
($(OS),Windows_NT)
CLEANUP
=
del /F /Q
MKDIR
=
mkdir
TARGET_EXTENSION
=
.exe
else
CLEANUP
=
rm
-f
MKDIR
=
mkdir
-p
TARGET_EXTENSION
=
.out
endif
UNITY_ROOT
=
../..
C_COMPILER
=
gcc
CFLAGS
=
-std
=
c99
CFLAGS
+=
-Wall
CFLAGS
+=
-Wextra
CFLAGS
+=
-Werror
CFLAGS
+=
-Wpointer-arith
CFLAGS
+=
-Wcast-align
CFLAGS
+=
-Wwrite-strings
CFLAGS
+=
-Wswitch-default
CFLAGS
+=
-Wunreachable-code
CFLAGS
+=
-Winit-self
CFLAGS
+=
-Wmissing-field-initializers
CFLAGS
+=
-Wno-unknown-pragmas
CFLAGS
+=
-Wstrict-prototypes
CFLAGS
+=
-Wundef
CFLAGS
+=
-Wold-style-definition
TARGET_BASE1
=
test1
TARGET_BASE2
=
test2
TARGET1
=
$(TARGET_BASE1)$(TARGET_EXTENSION)
TARGET2
=
$(TARGET_BASE2)$(TARGET_EXTENSION)
SRC_FILES1
=
$(UNITY_ROOT)
/src/unity.c src/ProductionCode.c
test
/TestProductionCode.c
test
/no_ruby/TestProductionCode_Runner.c
SRC_FILES2
=
$(UNITY_ROOT)
/src/unity.c src/ProductionCode2.c
test
/TestProductionCode2.c
test
/no_ruby/TestProductionCode2_Runner.c
INC_DIRS
=
-Isrc
-I
$(UNITY_ROOT)
/src
SYMBOLS
=
-DTEST
all
:
clean default
default
:
# ruby auto/generate_test_runner.rb test/TestProductionCode.c test/no_ruby/TestProductionCode_Runner.c
# ruby auto/generate_test_runner.rb test/TestProductionCode2.c test/no_ruby/TestProductionCode2_Runner.c
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES1)
-o
$(TARGET1)
$(C_COMPILER)
$(CFLAGS)
$(INC_DIRS)
$(SYMBOLS)
$(SRC_FILES2)
-o
$(TARGET2)
./$(TARGET1)
./$(TARGET2)
clean
:
$(CLEANUP)
examples/example_3/test/no_ruby/TestProductionCode2_Runner.c
已删除
100644 → 0
浏览文件 @
b922d622
/* AUTOGENERATED FILE. DO NOT EDIT. */
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
char
MessageBuffer
[
50
];
extern
void
setUp
(
void
);
extern
void
tearDown
(
void
);
extern
void
test_IgnoredTest
(
void
);
extern
void
test_AnotherIgnoredTest
(
void
);
extern
void
test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented
(
void
);
void
resetTest
(
void
);
void
resetTest
(
void
)
{
tearDown
();
setUp
();
}
int
main
(
void
)
{
UnityBegin
(
"test/TestProductionCode2.c"
);
RUN_TEST
(
test_IgnoredTest
,
13
);
RUN_TEST
(
test_AnotherIgnoredTest
,
18
);
RUN_TEST
(
test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented
,
23
);
UnityEnd
();
return
0
;
}
examples/example_3/test/no_ruby/TestProductionCode_Runner.c
已删除
100644 → 0
浏览文件 @
b922d622
/* AUTOGENERATED FILE. DO NOT EDIT. */
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
char
MessageBuffer
[
50
];
extern
void
setUp
(
void
);
extern
void
tearDown
(
void
);
extern
void
test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode
(
void
);
extern
void
test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken
(
void
);
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue
(
void
);
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain
(
void
);
extern
void
test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed
(
void
);
void
resetTest
(
void
);
void
resetTest
(
void
)
{
tearDown
();
setUp
();
}
int
main
(
void
)
{
UnityBegin
(
"test/TestProductionCode.c"
);
RUN_TEST
(
test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode
,
20
);
RUN_TEST
(
test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken
,
30
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue
,
41
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain
,
51
);
RUN_TEST
(
test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed
,
57
);
UnityEnd
();
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录