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:
mvandervoord
2010-04-02 18:37:30 +00:00
parent 86ab6eeb29
commit 3286a50ff8
3 changed files with 23 additions and 17 deletions
+10 -4
View File
@@ -3,6 +3,7 @@ HERE = File.expand_path(File.dirname(__FILE__)) + '/'
require 'rake' require 'rake'
require 'rake/clean' require 'rake/clean'
require 'rake/testtask' require 'rake/testtask'
require 'vendor/unity/auto/colour_reporter.rb'
#Tool and Lib Locations #Tool and Lib Locations
C_COMPILER = 'gcc' C_COMPILER = 'gcc'
@@ -22,14 +23,19 @@ SYMBOLS = '-DTEST -DEXCEPTION_USE_CONFIG_FILE'
CLEAN.include("#{HERE}*.out") CLEAN.include("#{HERE}*.out")
task :default => [:clobber, :test] task :default => [:clobber, :test]
task :cruise => [:no_color, :default]
desc "performs a quick set of unit tests to confirm you're ready to go" desc "performs a quick set of unit tests to confirm you're ready to go"
task :test do 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}` 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}` output = `#{HERE}#{OUT_FILE}#{OUT_EXTENSION}`
puts output report output
end
task :no_color do
$colour_output = false
end end
+1 -1
View File
@@ -39,7 +39,7 @@ void test_BasicThrowAndCatch(void)
Catch(e) Catch(e)
{ {
//verify that e has the right data //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 //verify that e STILL has the right data
+12 -12
View File
@@ -43,18 +43,18 @@ int main(void)
UnityBegin(); UnityBegin();
// RUN_TEST calls runTest // RUN_TEST calls runTest
RUN_TEST(test_BasicTryDoesNothingIfNoThrow); RUN_TEST(test_BasicTryDoesNothingIfNoThrow, 12);
RUN_TEST(test_BasicThrowAndCatch); RUN_TEST(test_BasicThrowAndCatch, 30);
RUN_TEST(test_BasicThrowAndCatch_WithMiniSyntax); RUN_TEST(test_BasicThrowAndCatch_WithMiniSyntax, 49);
RUN_TEST(test_VerifyVolatilesSurviveThrowAndCatch); RUN_TEST(test_VerifyVolatilesSurviveThrowAndCatch, 69);
RUN_TEST(test_ThrowFromASubFunctionAndCatchInRootFunc); RUN_TEST(test_ThrowFromASubFunctionAndCatchInRootFunc, 98);
RUN_TEST(test_ThrowAndCatchFromASubFunctionAndRethrowToCatchInRootFunc); RUN_TEST(test_ThrowAndCatchFromASubFunctionAndRethrowToCatchInRootFunc, 139);
RUN_TEST(test_ThrowAndCatchFromASubFunctionAndNoRethrowToCatchInRootFunc); RUN_TEST(test_ThrowAndCatchFromASubFunctionAndNoRethrowToCatchInRootFunc, 158);
RUN_TEST(test_CanHaveMultipleTryBlocksInASingleFunction); RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThisDoesntCorruptExceptionId, 175);
RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowInside); RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThatEachExceptionIdIndependent, 193);
RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside); RUN_TEST(test_CanHaveMultipleTryBlocksInASingleFunction, 220);
RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThisDoesntCorruptExceptionId); RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowInside, 245);
RUN_TEST(test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThatEachExceptionIdIndependent); RUN_TEST(test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside, 269);
UnityEnd(); UnityEnd();