mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-05-26 04:02:48 +08:00
Do NOT include the default test runner if a custom runner has been defined.
Cleanup some style issues.
This commit is contained in:
@ -182,10 +182,10 @@ Memory Assertions
|
|||||||
Compare two blocks of memory. This is a good generic assertion for types that can't be coerced into acting like
|
Compare two blocks of memory. This is a good generic assertion for types that can't be coerced into acting like
|
||||||
standard types... but since it's a memory compare, you have to be careful that your data types are packed.
|
standard types... but since it's a memory compare, you have to be careful that your data types are packed.
|
||||||
|
|
||||||
_MESSAGE
|
\_MESSAGE
|
||||||
--------
|
---------
|
||||||
|
|
||||||
you can append _MESSAGE to any of the macros to make them take an additional argument. This argument
|
you can append \_MESSAGE to any of the macros to make them take an additional argument. This argument
|
||||||
is a string that will be printed at the end of the failure strings. This is useful for specifying more
|
is a string that will be printed at the end of the failure strings. This is useful for specifying more
|
||||||
information about the problem.
|
information about the problem.
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ class UnityTestRunnerGenerator
|
|||||||
output.puts(' return suiteTearDown(UnityEnd());')
|
output.puts(' return suiteTearDown(UnityEnd());')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
output.puts(' return UnityEnd();') if not @options[:omit_begin_end]
|
output.puts(' return UnityEnd();') unless @options[:omit_begin_end]
|
||||||
end
|
end
|
||||||
output.puts('}')
|
output.puts('}')
|
||||||
end
|
end
|
||||||
|
@ -148,7 +148,7 @@ def run_tests
|
|||||||
load_configuration($cfg_file)
|
load_configuration($cfg_file)
|
||||||
test_defines = ['TEST']
|
test_defines = ['TEST']
|
||||||
$cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil?
|
$cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil?
|
||||||
$cfg['compiler']['defines']['items'] << "UNITY_FIXTURE_NO_EXTRAS"
|
$cfg['compiler']['defines']['items'] << 'UNITY_FIXTURE_NO_EXTRAS'
|
||||||
|
|
||||||
# Get a list of all source files needed
|
# Get a list of all source files needed
|
||||||
src_files = Dir["#{__dir__}/src/*.c"]
|
src_files = Dir["#{__dir__}/src/*.c"]
|
||||||
|
@ -146,7 +146,7 @@ def report_summary
|
|||||||
summary.run
|
summary.run
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_tests(exclude_stdlib=false)
|
def run_tests(exclude_stdlib = false)
|
||||||
report 'Running Unity system tests...'
|
report 'Running Unity system tests...'
|
||||||
|
|
||||||
# Tack on TEST define for compiling unit tests
|
# Tack on TEST define for compiling unit tests
|
||||||
|
@ -1800,6 +1800,8 @@ void UnityMessage(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
|
/* If we have not defined our own test runner, then include our default test runner to make life easier */
|
||||||
|
#ifndef RUN_TEST
|
||||||
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
||||||
{
|
{
|
||||||
Unity.CurrentTestName = FuncName;
|
Unity.CurrentTestName = FuncName;
|
||||||
@ -1819,6 +1821,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
|
|||||||
UNITY_EXEC_TIME_STOP();
|
UNITY_EXEC_TIME_STOP();
|
||||||
UnityConcludeTest();
|
UnityConcludeTest();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
void UnitySetTestFile(const char* filename)
|
void UnitySetTestFile(const char* filename)
|
||||||
|
@ -479,7 +479,10 @@ void UnityBegin(const char* filename);
|
|||||||
int UnityEnd(void);
|
int UnityEnd(void);
|
||||||
void UnitySetTestFile(const char* filename);
|
void UnitySetTestFile(const char* filename);
|
||||||
void UnityConcludeTest(void);
|
void UnityConcludeTest(void);
|
||||||
|
|
||||||
|
#ifndef RUN_TEST
|
||||||
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum);
|
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------------
|
/*-------------------------------------------------------
|
||||||
* Details Support
|
* Details Support
|
||||||
|
@ -51,7 +51,12 @@ task :summary do
|
|||||||
report_summary
|
report_summary
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Build and test Unity"
|
namespace :test do
|
||||||
|
desc "Build and test Unity"
|
||||||
|
task :all => [:clean, :prepare_for_tests, :scripts, :unit, :style, :summary]
|
||||||
|
end
|
||||||
|
|
||||||
|
# Shorthand for many common tasks
|
||||||
task :all => [:clean, :prepare_for_tests, :scripts, :unit, :style, :summary]
|
task :all => [:clean, :prepare_for_tests, :scripts, :unit, :style, :summary]
|
||||||
task :default => [:clobber, :all]
|
task :default => [:clobber, :all]
|
||||||
task :ci => [:no_color, :default]
|
task :ci => [:no_color, :default]
|
||||||
|
Reference in New Issue
Block a user