Updated to pull in latest Unity to get type_sanitizer to commonize converting a file name to a valid C identifier for use as mock names, since was duplicated in Unity, CMock and Ceedling.

This commit is contained in:
Greg Williams
2015-03-12 11:06:34 -04:00
parent 90e5ae59b0
commit 422077c929
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
# ==========================================
$here = File.dirname __FILE__
require "#{$here}/../vendor/unity/auto/type_sanitizer"
class CMockGenerator
@@ -28,7 +29,7 @@ class CMockGenerator
def create_mock(module_name, parsed_stuff)
@module_name = module_name
@mock_name = @prefix + @module_name
@clean_mock_name = @mock_name.gsub(/(?:-|\.\s+)/, "_")
@clean_mock_name = TypeSanitizer.sanitize_c_identifier(@mock_name)
create_mock_header_file(parsed_stuff)
create_mock_source_file(parsed_stuff)
end
@@ -63,7 +64,7 @@ class CMockGenerator
end
def create_mock_header_header(file, filename)
define_name = @clean_mock_name.gsub(/[-\/\\\.\,\s]+/,'_').upcase
define_name = @clean_mock_name.upcase
orig_filename = filename[@config.mock_prefix.size..-1]
file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n"
file << "#ifndef _#{define_name}_H\n"
+1 -1
View File
@@ -1,2 +1,2 @@
2.1
2.3
+1 -1