mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-09-03 08:50:01 +00: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:
@@ -123,8 +123,8 @@ class UnityTestRunnerGenerator
|
|||||||
output.puts("\n//=======Automagically Detected Files To Include=====")
|
output.puts("\n//=======Automagically Detected Files To Include=====")
|
||||||
output.puts("#include \"#{@options[:framework].to_s}.h\"")
|
output.puts("#include \"#{@options[:framework].to_s}.h\"")
|
||||||
output.puts('#include "cmock.h"') unless (mocks.empty?)
|
output.puts('#include "cmock.h"') unless (mocks.empty?)
|
||||||
@options[:includes].flatten.uniq.compact.each do |includes|
|
@options[:includes].flatten.uniq.compact.each do |inc|
|
||||||
output.puts("#include \"#{includes.gsub('.h','')}.h\"")
|
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}")
|
||||||
end
|
end
|
||||||
output.puts('#include <setjmp.h>')
|
output.puts('#include <setjmp.h>')
|
||||||
output.puts('#include <stdio.h>')
|
output.puts('#include <stdio.h>')
|
||||||
@@ -274,7 +274,7 @@ if ($0 == __FILE__)
|
|||||||
case(arg)
|
case(arg)
|
||||||
when '-cexception'
|
when '-cexception'
|
||||||
options[:plugins] = [:cexception]; true
|
options[:plugins] = [:cexception]; true
|
||||||
when /\w+\.yml/
|
when /\.*\.yml/
|
||||||
options = UnityTestRunnerGenerator.grab_config(arg); true
|
options = UnityTestRunnerGenerator.grab_config(arg); true
|
||||||
else false
|
else false
|
||||||
end
|
end
|
||||||
@@ -292,7 +292,7 @@ if ($0 == __FILE__)
|
|||||||
ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1])
|
ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1])
|
||||||
|
|
||||||
#everything else is an include file
|
#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])
|
UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,10 +8,13 @@
|
|||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
|
CEXCEPTION_T e; \
|
||||||
|
Try { \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
@@ -24,8 +27,12 @@
|
|||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
|
#include "two.h"
|
||||||
|
#include "three.h"
|
||||||
|
#include <four.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "CException.h"
|
||||||
#include "Mockstanky.h"
|
#include "Mockstanky.h"
|
||||||
|
|
||||||
//=======External Functions This Runner Calls=====
|
//=======External Functions This Runner Calls=====
|
||||||
|
|||||||
@@ -8,8 +8,11 @@
|
|||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
|
CEXCEPTION_T e; \
|
||||||
|
Try { \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
@@ -20,8 +23,12 @@
|
|||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
|
#include "two.h"
|
||||||
|
#include "three.h"
|
||||||
|
#include <four.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "CException.h"
|
||||||
|
|
||||||
//=======External Functions This Runner Calls=====
|
//=======External Functions This Runner Calls=====
|
||||||
extern void setUp(void);
|
extern void setUp(void);
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
:unity:
|
:unity:
|
||||||
:includes
|
:includes:
|
||||||
- two.h
|
- two.h
|
||||||
- three.h
|
- three.h
|
||||||
|
- <four.h>
|
||||||
:plugins:
|
:plugins:
|
||||||
- :cexception
|
- :cexception
|
||||||
:suite_setup: |
|
:suite_setup: |
|
||||||
|
|||||||
Reference in New Issue
Block a user