diff --git a/rakefile.rb b/rakefile.rb index 88d9a4f..325b9b2 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -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 \ No newline at end of file diff --git a/test/TestException.c b/test/TestException.c index 8b34186..1abc5a4 100644 --- a/test/TestException.c +++ b/test/TestException.c @@ -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 diff --git a/test/TestException_Runner.c b/test/TestException_Runner.c index 06dee09..53a008f 100644 --- a/test/TestException_Runner.c +++ b/test/TestException_Runner.c @@ -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();