mirror of
https://github.com/ThrowTheSwitch/Unity
synced 2025-05-21 02:09:34 -04:00
- 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
This commit is contained in:
parent
4b8d521247
commit
aca9892418
@ -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);
|
||||
|
3
test/testdata/sample.yml
vendored
3
test/testdata/sample.yml
vendored
@ -1,7 +1,8 @@
|
||||
:unity:
|
||||
:includes
|
||||
:includes:
|
||||
- two.h
|
||||
- three.h
|
||||
- <four.h>
|
||||
:plugins:
|
||||
- :cexception
|
||||
:suite_setup: |
|
||||
|
Loading…
x
Reference in New Issue
Block a user