ceedling 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +55 -6
- data/examples/temp_sensor/project.yml +2 -2
- data/lib/ceedling/version.rb +3 -3
- data/lib/ceedling/version.rb.erb +1 -1
- data/new_project_template/project.yml +1 -1
- data/new_project_template/vendor/ceedling/{vendor/c_exception/docs → docs}/CExceptionSummary.pdf +0 -0
- data/new_project_template/vendor/ceedling/vendor/cmock/docs/CMock Summary.pdf b/data/new_project_template/vendor/ceedling/docs/CMock → Summary.pdf +0 -0
- data/new_project_template/vendor/ceedling/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf b/data/new_project_template/vendor/ceedling/docs/Unity → Summary.pdf +0 -0
- data/new_project_template/vendor/ceedling/lib/configurator.rb +65 -16
- data/new_project_template/vendor/ceedling/lib/configurator_builder.rb +1 -8
- data/new_project_template/vendor/ceedling/lib/configurator_plugins.rb +8 -1
- data/new_project_template/vendor/ceedling/lib/configurator_setup.rb +30 -34
- data/new_project_template/vendor/ceedling/lib/configurator_validator.rb +32 -5
- data/new_project_template/vendor/ceedling/lib/constants.rb +17 -4
- data/new_project_template/vendor/ceedling/lib/defaults.rb +120 -106
- data/new_project_template/vendor/ceedling/lib/file_path_utils.rb +1 -1
- data/new_project_template/vendor/ceedling/lib/generator.rb +14 -6
- data/new_project_template/vendor/ceedling/lib/objects.yml +5 -0
- data/new_project_template/vendor/ceedling/lib/plugin.rb +2 -1
- data/new_project_template/vendor/ceedling/lib/plugin_manager.rb +6 -1
- data/new_project_template/vendor/ceedling/lib/preprocessinator_file_handler.rb +2 -2
- data/new_project_template/vendor/ceedling/lib/preprocessinator_includes_handler.rb +2 -2
- data/new_project_template/vendor/ceedling/lib/rules_cmock.rake +1 -1
- data/new_project_template/vendor/ceedling/lib/rules_preprocess.rake +2 -2
- data/new_project_template/vendor/ceedling/lib/rules_release.rake +4 -4
- data/new_project_template/vendor/ceedling/lib/rules_release_aux_dependencies.rake +1 -1
- data/new_project_template/vendor/ceedling/lib/rules_tests.rake +5 -5
- data/new_project_template/vendor/ceedling/lib/rules_tests_aux_dependencies.rake +1 -1
- data/new_project_template/vendor/ceedling/lib/setupinator.rb +10 -3
- data/new_project_template/vendor/ceedling/lib/system_utils.rb +32 -0
- data/new_project_template/vendor/ceedling/lib/system_wrapper.rb +13 -5
- data/new_project_template/vendor/ceedling/lib/tasks_base.rake +2 -2
- data/new_project_template/vendor/ceedling/lib/tasks_release.rake +1 -1
- data/new_project_template/vendor/ceedling/lib/tasks_tests.rake +1 -1
- data/new_project_template/vendor/ceedling/lib/tool_executor.rb +38 -10
- data/new_project_template/vendor/ceedling/lib/tool_executor_helper.rb +68 -10
- data/new_project_template/vendor/ceedling/plugins/bullseye/bullseye.rake +142 -0
- data/new_project_template/vendor/ceedling/plugins/bullseye/bullseye.rb +145 -0
- data/new_project_template/vendor/ceedling/plugins/bullseye/defaults.yml +49 -0
- data/new_project_template/vendor/ceedling/plugins/bullseye/template.erb +15 -0
- data/new_project_template/vendor/ceedling/plugins/gcov/defaults.yml +34 -0
- data/new_project_template/vendor/ceedling/plugins/gcov/gcov.rake +136 -0
- data/new_project_template/vendor/ceedling/plugins/gcov/gcov.rb +115 -0
- data/new_project_template/vendor/ceedling/plugins/gcov/template.erb +15 -0
- data/new_project_template/vendor/ceedling/plugins/stdout_ide_tests_report/stdout_ide_tests_report.rb +1 -1
- data/new_project_template/vendor/ceedling/plugins/stdout_pretty_tests_report/stdout_pretty_tests_report.rb +3 -63
- data/new_project_template/vendor/ceedling/plugins/stdout_pretty_tests_report/template.erb +59 -0
- data/new_project_template/vendor/ceedling/plugins/warnings_report/warnings_report.rb +71 -0
- data/new_project_template/vendor/ceedling/release/build.info +1 -1
- data/new_project_template/vendor/ceedling/vendor/c_exception/release/version.info +1 -1
- data/new_project_template/vendor/ceedling/vendor/unity/src/unity.c +30 -21
- metadata +18 -27
- data/new_project_template/vendor/ceedling/docs/Ceedling Packet.odt +0 -0
- data/new_project_template/vendor/ceedling/docs/CeedlingLogo.png +0 -0
- data/new_project_template/vendor/ceedling/rakefile.rb +0 -59
- data/new_project_template/vendor/ceedling/rakefile_helper.rb +0 -23
- data/new_project_template/vendor/ceedling/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
- data/new_project_template/vendor/ceedling/vendor/c_exception/docs/license.txt +0 -30
- data/new_project_template/vendor/ceedling/vendor/c_exception/docs/readme.txt +0 -236
- data/new_project_template/vendor/ceedling/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -217
- data/new_project_template/vendor/ceedling/vendor/cmock/docs/CMock Summary.odt +0 -0
- data/new_project_template/vendor/ceedling/vendor/cmock/docs/license.txt +0 -31
- data/new_project_template/vendor/ceedling/vendor/deep_merge/MIT-LICENSE +0 -20
- data/new_project_template/vendor/ceedling/vendor/deep_merge/README +0 -94
- data/new_project_template/vendor/ceedling/vendor/deep_merge/Rakefile +0 -28
- data/new_project_template/vendor/ceedling/vendor/deep_merge/test/test_deep_merge.rb +0 -553
- data/new_project_template/vendor/ceedling/vendor/diy/History.txt +0 -28
- data/new_project_template/vendor/ceedling/vendor/diy/README.rdoc +0 -233
- data/new_project_template/vendor/ceedling/vendor/unity/docs/Unity Summary.odt +0 -0
- data/new_project_template/vendor/ceedling/vendor/unity/docs/Unity Summary.pdf +0 -0
- data/new_project_template/vendor/ceedling/vendor/unity/docs/Unity Summary.txt +0 -217
- data/new_project_template/vendor/ceedling/vendor/unity/docs/license.txt +0 -31
Binary file
|
Binary file
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/config/test_environment'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/clean'
|
4
|
-
require 'rake/testtask'
|
5
|
-
require 'rakefile_helper'
|
6
|
-
|
7
|
-
TEST_FILE_SUFFIX = '_test.rb'
|
8
|
-
TEST_FILE_PATTERN = "*#{TEST_FILE_SUFFIX}"
|
9
|
-
|
10
|
-
include RakefileHelpers
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
task :default => ['test:all']
|
15
|
-
task :cruise => [:default]
|
16
|
-
|
17
|
-
|
18
|
-
unit_test_pattern = "test/unit/#{TEST_FILE_PATTERN}"
|
19
|
-
integrations_test_pattern = "test/integration/#{TEST_FILE_PATTERN}"
|
20
|
-
system_test_pattern = "test/system/#{TEST_FILE_PATTERN}"
|
21
|
-
|
22
|
-
ALL_UNIT_TESTS = FileList[unit_test_pattern]
|
23
|
-
ALL_INTEGRATION_TESTS = FileList[integrations_test_pattern]
|
24
|
-
ALL_SYSTEM_TESTS = FileList[system_test_pattern]
|
25
|
-
|
26
|
-
|
27
|
-
namespace :test do
|
28
|
-
desc "Run all unit, integration, and system tests"
|
29
|
-
task :all => ['test:unit:all']
|
30
|
-
|
31
|
-
Rake::TestTask.new('unit:all') do |t|
|
32
|
-
t.pattern = unit_test_pattern
|
33
|
-
t.verbose = true
|
34
|
-
end
|
35
|
-
|
36
|
-
namespace :unit do
|
37
|
-
create_test_tasks(ALL_UNIT_TESTS)
|
38
|
-
end
|
39
|
-
|
40
|
-
Rake::TestTask.new('integration:all') do |t|
|
41
|
-
t.pattern = integrations_test_pattern
|
42
|
-
t.verbose = true
|
43
|
-
end
|
44
|
-
|
45
|
-
namespace :integration do
|
46
|
-
create_test_tasks(ALL_INTEGRATION_TESTS)
|
47
|
-
end
|
48
|
-
|
49
|
-
Rake::TestTask.new('system:all') do |t|
|
50
|
-
t.pattern = system_test_pattern
|
51
|
-
t.verbose = true
|
52
|
-
end
|
53
|
-
|
54
|
-
namespace :system do
|
55
|
-
create_test_tasks(ALL_SYSTEM_TESTS)
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
module RakefileHelpers
|
5
|
-
|
6
|
-
def report(message)
|
7
|
-
puts message
|
8
|
-
$stdout.flush
|
9
|
-
$stderr.flush
|
10
|
-
end
|
11
|
-
|
12
|
-
def create_test_tasks(test_list)
|
13
|
-
test_list.each do |test|
|
14
|
-
base_file = File.basename(test).gsub(/#{Regexp.escape(TEST_FILE_SUFFIX)}/, '')
|
15
|
-
desc base_file
|
16
|
-
Rake::TestTask.new(base_file) do |t|
|
17
|
-
t.test_files = [test]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
Binary file
|
@@ -1,30 +0,0 @@
|
|
1
|
-
Copyright (c) 2007 Mark VanderVoord
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person
|
4
|
-
obtaining a copy of this software and associated documentation
|
5
|
-
files (the "Software"), to deal in the Software without
|
6
|
-
restriction, including without limitation the rights to use,
|
7
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the
|
9
|
-
Software is furnished to do so, subject to the following
|
10
|
-
conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
The end-user documentation included with the redistribution, if
|
16
|
-
any, must include the following acknowledgment: "This product
|
17
|
-
includes software developed for the CEXCeption Project, by Mark
|
18
|
-
VanderVoord and other contributors", in the same place and form
|
19
|
-
as other third-party acknowledgments. Alternately, this
|
20
|
-
acknowledgment may appear in the software itself, in the same
|
21
|
-
form and location as other such third-party acknowledgments.
|
22
|
-
|
23
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
24
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
25
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
26
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
27
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
28
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
29
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
30
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,236 +0,0 @@
|
|
1
|
-
====================================================================
|
2
|
-
CException
|
3
|
-
====================================================================
|
4
|
-
|
5
|
-
CException is a basic exception framework for C, suitable for use in
|
6
|
-
embedded applications. It provides an exception framework similar in
|
7
|
-
use to C++, but with much less overhead.
|
8
|
-
|
9
|
-
CException uses C standard library functions setjmp and longjmp to
|
10
|
-
operate. As long as the target system has these two functions defined,
|
11
|
-
this library should be useable with very little configuration. It
|
12
|
-
even supports environments where multiple program flows are in use,
|
13
|
-
such as real-time operating systems.
|
14
|
-
|
15
|
-
There are about a gabillion exception frameworks using a similar
|
16
|
-
setjmp/longjmp method out there... and there will probably be more
|
17
|
-
in the future. Unfortunately, when we started our last embedded
|
18
|
-
project, all those that existed either (a) did not support multiple
|
19
|
-
tasks (therefore multiple stacks) or (b) were way more complex than
|
20
|
-
we really wanted. CException was born.
|
21
|
-
|
22
|
-
Why use CException?
|
23
|
-
|
24
|
-
0. It's ANSI C, and it beats passing error codes around.
|
25
|
-
|
26
|
-
1. You want something simple... CException throws a single id. You can
|
27
|
-
define those ID's to be whatever you like. You might even choose which
|
28
|
-
type that number is for your project. But that's as far as it goes.
|
29
|
-
We weren't interested in passing objects or structs or strings...
|
30
|
-
just simple error codes.
|
31
|
-
|
32
|
-
2. Performance... CException can be configured for single tasking or
|
33
|
-
multitasking. In single tasking, there is very little overhead past
|
34
|
-
the setjmp/longjmp calls (which are already fast). In multitasking,
|
35
|
-
your only additional overhead is the time it takes you to determine
|
36
|
-
a unique task id 0 - num_tasks.
|
37
|
-
|
38
|
-
For the latest version, go to http://cexception.sourceforge.net
|
39
|
-
|
40
|
-
--------------------------------------------------------------------
|
41
|
-
CONTENTS OF THIS DOCUMENT
|
42
|
-
--------------------------------------------------------------------
|
43
|
-
|
44
|
-
Usage
|
45
|
-
Limitations
|
46
|
-
API
|
47
|
-
Configuration
|
48
|
-
Testing
|
49
|
-
License
|
50
|
-
|
51
|
-
--------------------------------------------------------------------
|
52
|
-
Usage
|
53
|
-
--------------------------------------------------------------------
|
54
|
-
|
55
|
-
Code that is to be protected are wrapped in Try { } Catch { } blocks.
|
56
|
-
The code directly following the Try call is "protected", meaning that
|
57
|
-
if any Throws occur, program control is directly transferred to the
|
58
|
-
start of the Catch block.
|
59
|
-
|
60
|
-
A numerical exception ID is included with Throw, and is made accessible
|
61
|
-
from the Catch block.
|
62
|
-
|
63
|
-
Throws can occur from within function calls (nested as deeply as you
|
64
|
-
like) or directly from within the function itself.
|
65
|
-
|
66
|
-
--------------------------------------------------------------------
|
67
|
-
Limitations
|
68
|
-
--------------------------------------------------------------------
|
69
|
-
|
70
|
-
This library was made to be as fast as possible, and provide basic
|
71
|
-
exception handling. It is not a full-blown exception library. Because
|
72
|
-
of this, there are a few limitations that should be observed in order
|
73
|
-
to successfully utilize this library:
|
74
|
-
|
75
|
-
1. Do not directly "return" from within a Try block, nor "goto"
|
76
|
-
into or out of a Try block.
|
77
|
-
|
78
|
-
Why?
|
79
|
-
|
80
|
-
The "Try" macro allocates some local memory and alters a global
|
81
|
-
pointer. These are cleaned up at the top of the "Catch" macro.
|
82
|
-
Gotos and returns would bypass some of these steps, resulting in
|
83
|
-
memory leaks or unpredictable behavior.
|
84
|
-
|
85
|
-
2. If (a) you change local (stack) variables within your Try block,
|
86
|
-
AND (b) wish to make use of the updated values after an exception
|
87
|
-
is thrown, those variables should be made volatile. Note that this
|
88
|
-
is ONLY for locals and ONLY when you need access to them after a
|
89
|
-
throw.
|
90
|
-
|
91
|
-
Why?
|
92
|
-
|
93
|
-
Compilers optimize. There is no way to guarantee that the actual
|
94
|
-
memory location was updated and not just a register unless the
|
95
|
-
variable is marked volatile.
|
96
|
-
|
97
|
-
3. Memory which is malloc'd or new'd is not automatically released
|
98
|
-
when an error is thrown. This will sometimes be desirable, and
|
99
|
-
othertimes may not. It will be the responsibility of the Catch
|
100
|
-
block to perform this kind of cleanup.
|
101
|
-
|
102
|
-
Why?
|
103
|
-
|
104
|
-
There's just no easy way to track malloc'd memory, etc., without
|
105
|
-
replacing or wrapping malloc calls or something like that. This
|
106
|
-
is a light framework, so these options were not desirable.
|
107
|
-
|
108
|
-
--------------------------------------------------------------------
|
109
|
-
API
|
110
|
-
--------------------------------------------------------------------
|
111
|
-
|
112
|
-
Try
|
113
|
-
---
|
114
|
-
|
115
|
-
Try is a macro which starts a protected block. It MUST be followed by
|
116
|
-
a pair of braces or a single protected line (similar to an 'if'),
|
117
|
-
enclosing the data that is to be protected. It MUST be followed by a
|
118
|
-
Catch block (don't worry, you'll get compiler errors to let you know if
|
119
|
-
you mess any of that up).
|
120
|
-
|
121
|
-
Catch(e)
|
122
|
-
--------
|
123
|
-
|
124
|
-
Catch is a macro which ends the Try block and starts the error handling
|
125
|
-
block. The catch block is called if and only if an exception was thrown
|
126
|
-
while within the Try block. This error was thrown by a Throw call
|
127
|
-
somewhere within Try (or within a function called within Try, or a function
|
128
|
-
called by a function called within Try, etc).
|
129
|
-
|
130
|
-
The single parameter 'e' is filled with the error code which was thrown.
|
131
|
-
This can be used for reporting, conditional cleanup, etc. (or you can just
|
132
|
-
ignore it if you really want... people ignore return codes all the time,
|
133
|
-
right?). 'e' should be of type EXCEPTION_T;
|
134
|
-
|
135
|
-
Throw(e)
|
136
|
-
--------
|
137
|
-
|
138
|
-
The method of throwing an error. Throws should only occur from within a
|
139
|
-
protected (Try...Catch) block, though it may easily be nested many function
|
140
|
-
calls deep without an impact on performance or functionality. Throw takes
|
141
|
-
a single argument, which is an exception id which will be passed to Catch
|
142
|
-
as the reason for the error.
|
143
|
-
|
144
|
-
If you wish to Rethrow an error, this can be done by calling Throw(e) with
|
145
|
-
the error code you just caught. It IS valid to throw from a catch block.
|
146
|
-
|
147
|
-
--------------------------------------------------------------------
|
148
|
-
CONFIGURATION
|
149
|
-
--------------------------------------------------------------------
|
150
|
-
|
151
|
-
CException is a mostly portable library. It has one universal
|
152
|
-
dependency, and some macros which are required if working in a
|
153
|
-
multi-tasking environment.
|
154
|
-
|
155
|
-
1. The standard C library setjmp must be available. Since this is part
|
156
|
-
of the standard library, chances are good that you'll be fine.
|
157
|
-
|
158
|
-
2. If working in a multitasking environment, methods for obtaining an
|
159
|
-
index into an array of frames and to get the overall number of
|
160
|
-
id's are required. If the OS supports a method to retrieve Task
|
161
|
-
ID's, and those Tasks are number 0, 1, 2... you are in an ideal
|
162
|
-
situation. Otherwise, a more creative mapping function may be
|
163
|
-
required. Note that this function is likely to be called twice
|
164
|
-
for each protected block and once during a throw. This is the
|
165
|
-
only overhead in the system.
|
166
|
-
|
167
|
-
Exception.h
|
168
|
-
-----------------
|
169
|
-
By convention, most projects include Exception.h which defines any
|
170
|
-
further requirements, then calls CException.h to do the gruntwork. All
|
171
|
-
of these are optional. You could directly include CException.h if
|
172
|
-
you wanted and just use the defaults provided.
|
173
|
-
|
174
|
-
EXCEPTION_T - Set this to the type you want your exception id's
|
175
|
-
to be. Defaults to 'unsigned int'.
|
176
|
-
|
177
|
-
EXCEPTION_NONE - Set this to a number which will never be an
|
178
|
-
exception id in your system. Defaults to 0x5a5a5a5a.
|
179
|
-
|
180
|
-
EXCEPTION_GET_ID - If in a multi-tasking environment, this should be
|
181
|
-
set to be a call to the function described in #2 above.
|
182
|
-
Defaults to just return 0 all the time (good for
|
183
|
-
single tasking environments)
|
184
|
-
|
185
|
-
EXCEPTION_NUM_ID - If in a multi-tasking environment, this should be set
|
186
|
-
to the number of ID's required (usually the number of
|
187
|
-
tasks in the system). Defaults to 1 (for single
|
188
|
-
tasking environments).
|
189
|
-
|
190
|
-
You may also want to include any header files which will commonly be
|
191
|
-
needed by the rest of your application where it uses exception handling
|
192
|
-
here. For example, OS header files or exception codes would be useful.
|
193
|
-
|
194
|
-
--------------------------------------------------------------------
|
195
|
-
TESTING
|
196
|
-
--------------------------------------------------------------------
|
197
|
-
|
198
|
-
If you want to validate that CException works with your tools or that
|
199
|
-
it works with your custom configuration, you may want to run the test
|
200
|
-
suite.
|
201
|
-
|
202
|
-
The test suite included makes use of the Unity Test Framework. It will
|
203
|
-
require a native C compiler. The example makefile uses MinGW's gcc.
|
204
|
-
Modify the makefile to include the proper paths to tools, then run 'make'
|
205
|
-
to compile and run the test application.
|
206
|
-
|
207
|
-
C_COMPILER - The C compiler to use to perform the tests
|
208
|
-
C_LIBS - The path to the C libraries (including setjmp)
|
209
|
-
UNITY_DIR - The path to the Unity framework (required to run tests)
|
210
|
-
(get it at http://embunity.sourceforge.net)
|
211
|
-
|
212
|
-
--------------------------------------------------------------------
|
213
|
-
LICENSE
|
214
|
-
--------------------------------------------------------------------
|
215
|
-
|
216
|
-
This software is licensed under the MIT License
|
217
|
-
|
218
|
-
Copyright (c) 2007 Mark VanderVoord
|
219
|
-
|
220
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
221
|
-
of this software and associated documentation files (the "Software"), to deal
|
222
|
-
in the Software without restriction, including without limitation the rights
|
223
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
224
|
-
copies of the Software, and to permit persons to whom the Software is
|
225
|
-
furnished to do so, subject to the following conditions:
|
226
|
-
|
227
|
-
The above copyright notice and this permission notice shall be included in
|
228
|
-
all copies or substantial portions of the Software.
|
229
|
-
|
230
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
231
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
232
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
233
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
234
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
235
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
236
|
-
THE SOFTWARE.
|
data/new_project_template/vendor/ceedling/vendor/c_exception/vendor/unity/docs/Unity Summary.txt
DELETED
@@ -1,217 +0,0 @@
|
|
1
|
-
==============
|
2
|
-
Unity Test API
|
3
|
-
==============
|
4
|
-
|
5
|
-
[Copyright (c) 2007 - Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams]
|
6
|
-
|
7
|
-
-------------
|
8
|
-
Running Tests
|
9
|
-
-------------
|
10
|
-
|
11
|
-
RUN_TEST(func, linenum)
|
12
|
-
|
13
|
-
Each Test is run within the macro RUN_TEST. This macro performs necessary setup before the test is called and handles cleanup and result tabulation afterwards.
|
14
|
-
|
15
|
-
--------------
|
16
|
-
Ignoring Tests
|
17
|
-
--------------
|
18
|
-
|
19
|
-
There are times when a test is incomplete or not valid for some reason. At these times, TEST_IGNORE can be called. Control will immediately be returned to the caller of the test, and no failures will be returned.
|
20
|
-
|
21
|
-
TEST_IGNORE()
|
22
|
-
|
23
|
-
Ignore this test and return immediately
|
24
|
-
|
25
|
-
TEST_IGNORE_MESSAGE (message)
|
26
|
-
|
27
|
-
Ignore this test and return immediately. Output a message stating why the test was ignored.
|
28
|
-
|
29
|
-
--------------
|
30
|
-
Aborting Tests
|
31
|
-
--------------
|
32
|
-
|
33
|
-
There are times when a test will contain an infinite loop on error conditions, or there may be reason to escape from the test early without executing the rest of the test. A pair of macros support this functionality in Unity. The first (TEST_PROTECT) sets up the feature, and handles emergency abort cases. TEST_ABORT can then be used at any time within the tests to return to the last TEST_PROTECT call.
|
34
|
-
|
35
|
-
TEST_PROTECT()
|
36
|
-
|
37
|
-
Setup and Catch macro
|
38
|
-
|
39
|
-
TEST_ABORT()
|
40
|
-
|
41
|
-
Abort Test macro
|
42
|
-
|
43
|
-
Example:
|
44
|
-
|
45
|
-
main()
|
46
|
-
{
|
47
|
-
if (TEST_PROTECT() == 0)
|
48
|
-
{
|
49
|
-
MyTest();
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
If MyTest calls TEST_ABORT, program control will immediately return to TEST_PROTECT with a non-zero return value.
|
54
|
-
|
55
|
-
|
56
|
-
=======================
|
57
|
-
Unity Assertion Summary
|
58
|
-
=======================
|
59
|
-
|
60
|
-
--------------------
|
61
|
-
Basic Validity Tests
|
62
|
-
--------------------
|
63
|
-
|
64
|
-
TEST_ASSERT_TRUE(condition)
|
65
|
-
|
66
|
-
Evaluates whatever code is in condition and fails if it evaluates to false
|
67
|
-
|
68
|
-
TEST_ASSERT_FALSE(condition)
|
69
|
-
|
70
|
-
Evaluates whatever code is in condition and fails if it evaluates to true
|
71
|
-
|
72
|
-
TEST_ASSERT(condition)
|
73
|
-
|
74
|
-
Another way of calling TEST_ASSERT_TRUE
|
75
|
-
|
76
|
-
TEST_ASSERT_UNLESS(condition)
|
77
|
-
|
78
|
-
Another way of calling TEST_ASSERT_FALSE
|
79
|
-
|
80
|
-
TEST_FAIL()
|
81
|
-
TEST_FAIL_MESSAGE(message)
|
82
|
-
|
83
|
-
This test is automatically marked as a failure. The message is output stating why.
|
84
|
-
|
85
|
-
------------------------------
|
86
|
-
Numerical Assertions: Integers
|
87
|
-
------------------------------
|
88
|
-
|
89
|
-
TEST_ASSERT_EQUAL_INT(expected, actual)
|
90
|
-
TEST_ASSERT_EQUAL_INT8(expected, actual)
|
91
|
-
TEST_ASSERT_EQUAL_INT16(expected, actual)
|
92
|
-
TEST_ASSERT_EQUAL_INT32(expected, actual)
|
93
|
-
TEST_ASSERT_EQUAL_INT64(expected, actual)
|
94
|
-
|
95
|
-
Compare two integers for equality and display errors as signed integers. A cast will be performed
|
96
|
-
to your natural integer size so often this can just be used. When you need to specify the exact size,
|
97
|
-
like when comparing arrays, you can use a specific version:
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
TEST_ASSERT_EQUAL_UINT(expected, actual)
|
102
|
-
|
103
|
-
Compare two integers for equality and display errors as unsigned integers. Like INT, there are
|
104
|
-
variants for different sizes also.
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
TEST_ASSERT_EQUAL_HEX(expected, actual)
|
109
|
-
|
110
|
-
Compares two integers for equality and display errors as hexadecimal. Like the other integer comparisons,
|
111
|
-
you can specify the size... here the size will also effect how many nibbles are shown (for example, HEX16
|
112
|
-
will show 4 nibbles).
|
113
|
-
|
114
|
-
_ARRAY
|
115
|
-
|
116
|
-
You can append _ARRAY to any of these macros to make an array comparison of that type. Here you will
|
117
|
-
need to care a bit more about the actual size of the value being checked. You will also specify an
|
118
|
-
additional argument which is the number of elements to compare. For example:
|
119
|
-
|
120
|
-
TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements)
|
121
|
-
|
122
|
-
|
123
|
-
TEST_ASSERT_EQUAL(expected, actual)
|
124
|
-
|
125
|
-
Another way of calling TEST_ASSERT_EQUAL_INT
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
TEST_ASSERT_INT_WITHIN(delta, expected, actual)
|
130
|
-
|
131
|
-
Asserts that the actual value is within plus or minus delta of the expected value. This also comes in
|
132
|
-
size specific variants.
|
133
|
-
|
134
|
-
|
135
|
-
-----------------------------
|
136
|
-
Numerical Assertions: Bitwise
|
137
|
-
-----------------------------
|
138
|
-
|
139
|
-
TEST_ASSERT_BITS(mask, expected, actual)
|
140
|
-
|
141
|
-
Use an integer mask to specify which bits should be compared between two other integers. High bits in the mask are compared, low bits ignored.
|
142
|
-
|
143
|
-
TEST_ASSERT_BITS_HIGH(mask, actual)
|
144
|
-
|
145
|
-
Use an integer mask to specify which bits should be inspected to determine if they are all set high. High bits in the mask are compared, low bits ignored.
|
146
|
-
|
147
|
-
TEST_ASSERT_BITS_LOW(mask, actual)
|
148
|
-
|
149
|
-
Use an integer mask to specify which bits should be inspected to determine if they are all set low. High bits in the mask are compared, low bits ignored.
|
150
|
-
|
151
|
-
TEST_ASSERT_BIT_HIGH(bit, actual)
|
152
|
-
|
153
|
-
Test a single bit and verify that it is high. The bit is specified 0-31 for a 32-bit integer.
|
154
|
-
|
155
|
-
TEST_ASSERT_BIT_LOW(bit, actual)
|
156
|
-
|
157
|
-
Test a single bit and verify that it is low. The bit is specified 0-31 for a 32-bit integer.
|
158
|
-
|
159
|
-
----------------------------
|
160
|
-
Numerical Assertions: Floats
|
161
|
-
----------------------------
|
162
|
-
|
163
|
-
TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual)
|
164
|
-
|
165
|
-
Asserts that the actual value is within plus or minus delta of the expected value.
|
166
|
-
|
167
|
-
TEST_ASSERT_EQUAL_FLOAT(expected, actual)
|
168
|
-
|
169
|
-
Asserts that two floating point values are "equal" within a small % delta of the expected value.
|
170
|
-
|
171
|
-
-----------------
|
172
|
-
String Assertions
|
173
|
-
-----------------
|
174
|
-
|
175
|
-
TEST_ASSERT_EQUAL_STRING(expected, actual)
|
176
|
-
|
177
|
-
Compare two null-terminate strings. Fail if any character is different or if the lengths are different.
|
178
|
-
|
179
|
-
TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message)
|
180
|
-
|
181
|
-
Compare two null-terminate strings. Fail if any character is different or if the lengths are different. Output a custom message on failure.
|
182
|
-
|
183
|
-
------------------
|
184
|
-
Pointer Assertions
|
185
|
-
------------------
|
186
|
-
|
187
|
-
Most pointer operations can be performed by simply using the integer comparisons above. However, a couple of special cases are added for clarity.
|
188
|
-
|
189
|
-
TEST_ASSERT_NULL(pointer)
|
190
|
-
|
191
|
-
Fails if the pointer is not equal to NULL
|
192
|
-
|
193
|
-
TEST_ASSERT_NOT_NULL(pointer)
|
194
|
-
|
195
|
-
Fails if the pointer is equal to NULL
|
196
|
-
|
197
|
-
|
198
|
-
-----------------
|
199
|
-
Memory Assertions
|
200
|
-
-----------------
|
201
|
-
|
202
|
-
TEST_ASSERT_EQUAL_MEMORY(expected, actual, len)
|
203
|
-
|
204
|
-
Compare two blocks of memory. This is a good generic assertion for types that can't be coerced into acting like
|
205
|
-
standard types... but since it's a memory compare, you have to be careful that your data types are packed.
|
206
|
-
|
207
|
-
--------
|
208
|
-
_MESSAGE
|
209
|
-
--------
|
210
|
-
|
211
|
-
you can append _MESSAGE to any of the macros to make them take an additional argument. This argument
|
212
|
-
is a string that will be printed at the end of the failure strings. This is useful for specifying more
|
213
|
-
information about the problem.
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|