提交 aca98924 编写于 作者: M mvandervoord

- fixed yaml load option

- added option to specify includes as <stdlib.h> so that they will get angle brackets instead of ""

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@114 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
上级 4b8d5212
......@@ -123,8 +123,8 @@ class UnityTestRunnerGenerator
output.puts("\n//=======Automagically Detected Files To Include=====")
output.puts("#include \"#{@options[:framework].to_s}.h\"")
output.puts('#include "cmock.h"') unless (mocks.empty?)
@options[:includes].flatten.uniq.compact.each do |includes|
output.puts("#include \"#{includes.gsub('.h','')}.h\"")
@options[:includes].flatten.uniq.compact.each do |inc|
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}")
end
output.puts('#include <setjmp.h>')
output.puts('#include <stdio.h>')
......@@ -274,7 +274,7 @@ if ($0 == __FILE__)
case(arg)
when '-cexception'
options[:plugins] = [:cexception]; true
when /\w+\.yml/
when /\.*\.yml/
options = UnityTestRunnerGenerator.grab_config(arg); true
else false
end
......@@ -292,7 +292,7 @@ if ($0 == __FILE__)
ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1])
#everything else is an include file
options[:includes] = (ARGV.slice(2..-1).flatten.compact) if (ARGV.size > 2)
options[:includes] ||= (ARGV.slice(2..-1).flatten.compact) if (ARGV.size > 2)
UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
end
......@@ -8,10 +8,13 @@
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
......@@ -24,8 +27,12 @@
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include "two.h"
#include "three.h"
#include <four.h>
#include <setjmp.h>
#include <stdio.h>
#include "CException.h"
#include "Mockstanky.h"
//=======External Functions This Runner Calls=====
......
......@@ -8,8 +8,11 @@
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
setUp(); \
TestFunc(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
......@@ -20,8 +23,12 @@
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "two.h"
#include "three.h"
#include <four.h>
#include <setjmp.h>
#include <stdio.h>
#include "CException.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
......
:unity:
:includes
:includes:
- two.h
- three.h
- <four.h>
:plugins:
- :cexception
:suite_setup: |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册