diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index f30593f1a55c94b4eecb378dad02aed40ef96b7c..14f71e289bd2a38c9d6e14b6c10369fb34e58c87 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -17,7 +17,7 @@ class UnityTestRunnerGenerator require 'yaml' yaml_guts = YAML.load_file(config_file) yaml_goodness = yaml_guts[:unity] ? yaml_guts[:unity] : yaml_guts[:cmock] - options[:cexception] = 1 if (yaml_goodness[:plugins].include? 'cexception') + options[:cexception] = 1 if (yaml_goodness[:plugins].include? :cexception) options[:coverage ] = 1 if (yaml_goodness[:coverage]) options[:order] = 1 if (yaml_goodness[:enforce_strict_ordering]) options[:includes] << (yaml_goodness[:includes]) @@ -95,6 +95,7 @@ class UnityTestRunnerGenerator def create_header(output, mocks) output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') output.puts('#include "unity.h"') + output.puts('#include "cmock.h"') @options[:includes].flatten.each do |includes| output.puts("#include \"#{includes.gsub('.h','')}.h\"") end diff --git a/src/unity.h b/src/unity.h index edc4324b328d13f17ccb9c7d02e2a439d3c9d8d6..08653174e9563e46bd4a33be7d88bbf6b1e8f492 100644 --- a/src/unity.h +++ b/src/unity.h @@ -211,7 +211,7 @@ void UnityAssertFloatsWithin(const _UF delta, // these are the macros you are looking for #define TEST_ASSERT_MESSAGE(condition, message) if (condition) {} else {TEST_FAIL(message);} -#define TEST_ASSERT(condition) TEST_ASSERT_MESSAGE(condition, NULL) +#define TEST_ASSERT(condition) TEST_ASSERT_MESSAGE(condition, "Expectation Failed.") #define TEST_ASSERT_TRUE_MESSAGE(condition, message) TEST_ASSERT_MESSAGE(condition, message) #define TEST_ASSERT_TRUE(condition) TEST_ASSERT_MESSAGE(condition, "Expected TRUE was FALSE.") @@ -223,7 +223,9 @@ void UnityAssertFloatsWithin(const _UF delta, #define TEST_ASSERT_FALSE(condition) TEST_ASSERT_MESSAGE(!(condition), "Expected FALSE was TRUE.") #define TEST_ASSERT_NULL(pointer) TEST_ASSERT_MESSAGE(pointer == NULL, #pointer " was not null.") +#define TEST_ASSERT_NULL_MESSAGE(pointer, message) TEST_ASSERT_MESSAGE(pointer == NULL, message) #define TEST_ASSERT_NOT_NULL(pointer) TEST_ASSERT_MESSAGE(pointer != NULL, #pointer " was null.") +#define TEST_ASSERT_NOT_NULL_MESSAGE(pointer, message) TEST_ASSERT_MESSAGE(pointer != NULL, message) #define TEST_ASSERT_EQUAL_INT_MESSAGE(expected, actual, message) \ Unity.TestFile=__FILE__; \