mirror of
https://github.com/throwtheswitch/cexception.git
synced 2026-09-12 13:19:58 +00:00
catch cexception up to modern unity
git-svn-id: http://cexception.svn.sourceforge.net/svnroot/cexception/trunk@10 50f63946-2846-0410-8d77-f904c773002e
This commit is contained in:
+10
-4
@@ -3,6 +3,7 @@ HERE = File.expand_path(File.dirname(__FILE__)) + '/'
|
||||
require 'rake'
|
||||
require 'rake/clean'
|
||||
require 'rake/testtask'
|
||||
require 'vendor/unity/auto/colour_reporter.rb'
|
||||
|
||||
#Tool and Lib Locations
|
||||
C_COMPILER = 'gcc'
|
||||
@@ -22,14 +23,19 @@ SYMBOLS = '-DTEST -DEXCEPTION_USE_CONFIG_FILE'
|
||||
CLEAN.include("#{HERE}*.out")
|
||||
|
||||
task :default => [:clobber, :test]
|
||||
task :cruise => [:no_color, :default]
|
||||
|
||||
desc "performs a quick set of unit tests to confirm you're ready to go"
|
||||
task :test do
|
||||
puts "#{C_COMPILER} #{INC_DIRS} #{LIB_DIRS} #{SYMBOLS} #{SRC_FILES} -o #{OUT_FILE}#{OUT_EXTENSION}"
|
||||
report "#{C_COMPILER} #{INC_DIRS} #{LIB_DIRS} #{SYMBOLS} #{SRC_FILES} -o #{OUT_FILE}#{OUT_EXTENSION}"
|
||||
output = `#{C_COMPILER} #{INC_DIRS} #{LIB_DIRS} #{SYMBOLS} #{SRC_FILES} -o #{OUT_FILE}#{OUT_EXTENSION}`
|
||||
puts output
|
||||
report output
|
||||
|
||||
puts "#{HERE}#{OUT_FILE}#{OUT_EXTENSION}"
|
||||
report "#{HERE}#{OUT_FILE}#{OUT_EXTENSION}"
|
||||
output = `#{HERE}#{OUT_FILE}#{OUT_EXTENSION}`
|
||||
puts output
|
||||
report output
|
||||
end
|
||||
|
||||
task :no_color do
|
||||
$colour_output = false
|
||||
end
|
||||
@@ -39,7 +39,7 @@ void test_BasicThrowAndCatch(void)
|
||||
Catch(e)
|
||||
{
|
||||
//verify that e has the right data
|
||||
TEST_ASSERT_EQUAL(0xBEEFBEEF, e)
|
||||
TEST_ASSERT_EQUAL(0xBEEFBEEF, e);
|
||||
}
|
||||
|
||||
//verify that e STILL has the right data
|
||||
|
||||
+12
-12
@@ -43,18 +43,18 @@ int main(void)
|
||||
UnityBegin();
|
||||
|
||||
// RUN_TEST calls runTest
|
||||
RUN_TEST(test_BasicTryDoesNothingIfNoThrow);
|
||||
RUN_TEST(test_BasicThrowAndCatch);
|
||||
RUN_TEST(test_BasicThrowAndCatch_WithMiniSyntax);
|
||||
RUN_TEST(test_VerifyVolatilesSurviveThrowAndCatch);
|
||||
RUN_TEST(test_ThrowFromASubFunctionAndCatchInRootFunc);
|
||||
RUN_TEST(test_ThrowAndCatchFromASubFunctionAndRethrowToCatchInRootFunc);
|
||||
RUN_TEST(test_ThrowAndCatchFromASubFunctionAndNoRethrowToCatchInRootFunc);
|
||||
RUN_TEST(test_CanHaveMultipleTryBlocksInASingleFunction);
|
||||
RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowInside);
|
||||
RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside);
|
||||
RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThisDoesntCorruptExceptionId);
|
||||
RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThatEachExceptionIdIndependent);
|
||||
RUN_TEST(test_BasicTryDoesNothingIfNoThrow, 12);
|
||||
RUN_TEST(test_BasicThrowAndCatch, 30);
|
||||
RUN_TEST(test_BasicThrowAndCatch_WithMiniSyntax, 49);
|
||||
RUN_TEST(test_VerifyVolatilesSurviveThrowAndCatch, 69);
|
||||
RUN_TEST(test_ThrowFromASubFunctionAndCatchInRootFunc, 98);
|
||||
RUN_TEST(test_ThrowAndCatchFromASubFunctionAndRethrowToCatchInRootFunc, 139);
|
||||
RUN_TEST(test_ThrowAndCatchFromASubFunctionAndNoRethrowToCatchInRootFunc, 158);
|
||||
RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThisDoesntCorruptExceptionId, 175);
|
||||
RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThatEachExceptionIdIndependent, 193);
|
||||
RUN_TEST(test_CanHaveMultipleTryBlocksInASingleFunction, 220);
|
||||
RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowInside, 245);
|
||||
RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside, 269);
|
||||
|
||||
UnityEnd();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user