提交 c3475a73 编写于 作者: M Mark VanderVoord

Merge pull request #25 from malsyned/fixture_fixes

Updates to make Fixture more useful (thanks malsyned! It's nice that someone is helping out with the Fixtures extension!)
......@@ -87,7 +87,7 @@ module RakefileHelpers
return {:command => command, :options => options, :includes => includes}
end
def link(exe_name, obj_list)
def link_it(exe_name, obj_list)
linker = build_linker_fields
cmd_str = "#{linker[:command]}#{linker[:options]}#{linker[:includes]} " +
(obj_list.map{|obj|"#{$cfg['linker']['object_files']['path']}#{obj} "}).join +
......@@ -148,7 +148,8 @@ module RakefileHelpers
# Get a list of all source files needed
src_files = Dir[HERE+'src/*.c']
src_files += Dir[HERE+'test/*.c']
src_files << '../../src/Unity.c'
src_files += Dir[HERE+'test/main/*.c']
src_files << '../../src/unity.c'
# Build object files
src_files.each { |f| compile(f, test_defines) }
......@@ -156,7 +157,7 @@ module RakefileHelpers
# Link the test executable
test_base = "framework_test"
link(test_base, obj_list)
link_it(test_base, obj_list)
# Execute unit test and generate results file
simulator = build_simulator_fields
......
......@@ -5,9 +5,9 @@
[Released under MIT License. Please refer to license.txt for details]
========================================== */
#include <string.h>
#include "unity_fixture.h"
#include "unity_internals.h"
#include <string.h>
UNITY_FIXTURE_T UnityFixture;
......@@ -112,11 +112,15 @@ void UnityTestRunner(unityfunction* setup,
}
}
void UnityIgnoreTest()
void UnityIgnoreTest(const char * printableName)
{
Unity.NumberOfTests++;
Unity.CurrentTestIgnored = 1;
UNITY_OUTPUT_CHAR('!');
if (!UnityFixture.Verbose)
UNITY_OUTPUT_CHAR('!');
else
UnityPrint(printableName);
UnityConcludeFixtureTest();
}
......@@ -356,6 +360,10 @@ void UnityConcludeFixtureTest()
{
if (Unity.CurrentTestIgnored)
{
if (UnityFixture.Verbose)
{
UNITY_OUTPUT_CHAR('\n');
}
Unity.TestIgnores++;
}
else if (!Unity.CurrentTestFailed)
......@@ -374,4 +382,3 @@ void UnityConcludeFixtureTest()
Unity.CurrentTestFailed = 0;
Unity.CurrentTestIgnored = 0;
}
......@@ -41,7 +41,7 @@ int UnityMain(int argc, char* argv[], void (*runAllTests)());
void TEST_##group##_##name##_();\
void TEST_##group##_##name##_run()\
{\
UnityIgnoreTest();\
UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")");\
}\
void TEST_##group##_##name##_()
......
......@@ -25,7 +25,7 @@ void UnityTestRunner(unityfunction * setup,
const char * name,
const char * file, int line);
void UnityIgnoreTest();
void UnityIgnoreTest(const char * printableName);
void UnityMalloc_StartTest();
void UnityMalloc_EndTest();
int UnityFailureCount();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册