From c8a944becfcd66d7b7882c83cfe9ee908a32ea63 Mon Sep 17 00:00:00 2001 From: mvandervoord Date: Tue, 21 Sep 2010 00:39:26 +0000 Subject: [PATCH] added 64 bit gcc target (works on a macbook, for example) git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@189 bf332499-1b4d-0410-844d-d2d48d5cc64c --- lib/cmock_header_parser.rb | 1 + targets/gcc_64.yml | 51 +++++++++++++++++++ .../test_interactions/parsing_challenges.yml | 6 +-- 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 targets/gcc_64.yml diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index f18dcf5..7055f14 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -85,6 +85,7 @@ class CMockHeaderParser end #drop extra white space to make the rest go faster + #source.gsub!(/(?:^|\s)(?:#{c_attributes.join('|')})(?:$|\s)/, '') #remove attributes source.gsub!(/^\s+/, '') # remove extra white space from beginning of line source.gsub!(/\s+$/, '') # remove extra white space from end of line source.gsub!(/\s*\(\s*/, '(') # remove extra white space from before left parens diff --git a/targets/gcc_64.yml b/targets/gcc_64.yml new file mode 100644 index 0000000..7bbbeff --- /dev/null +++ b/targets/gcc_64.yml @@ -0,0 +1,51 @@ +--- +compiler: + path: gcc + source_path: &systest_generated_path 'test/system/generated/' + unit_tests_path: &unit_tests_path 'examples/test/' + mocks_path: &systest_mocks_path 'test/system/generated/' + build_path: &systest_build_path 'test/system/build/' + options: + - '-c' + - '-Wall' + - '-std=c99' + - '-pedantic-errors' + includes: + prefix: '-I' + items: + - *systest_generated_path + - *unit_tests_path + - *systest_mocks_path + - 'src/' + - 'vendor/unity/src/' + - 'vendor/c_exception/lib/' + - 'test/system/test_compilation/' + - 'test/' + defines: + prefix: '-D' + items: + - 'UNITY_SUPPORT_64' + - 'UNITY_POINTER_WIDTH=64' + - 'CMOCK_MEM_PTR_AS_INT=long' + object_files: + prefix: '-o' + extension: '.o' + destination: *systest_build_path + +linker: + path: gcc + options: + - -lm + includes: + prefix: '-I' + object_files: + path: *systest_build_path + extension: '.o' + bin_files: + prefix: '-o' + extension: '.exe' + destination: *systest_build_path + +unsupported: [] + +colour: true diff --git a/test/system/test_interactions/parsing_challenges.yml b/test/system/test_interactions/parsing_challenges.yml index e64f69c..5294944 100644 --- a/test/system/test_interactions/parsing_challenges.yml +++ b/test/system/test_interactions/parsing_challenges.yml @@ -72,7 +72,7 @@ void exercise_var_args(int a, int b); void exercise_arglist_pointers(void); char exercise_multiline_declarations(int a, unsigned int b); - void exercise_double_pointers(unsigned int a); + void exercise_double_pointers(unsigned int** a); int exercise_many_descriptors(int a); TypeDefInt exercise_typedef_like_names(TypeDefInt a); @@ -104,7 +104,7 @@ return crazy_multiline(a, b); } - void exercise_double_pointers(unsigned int a) + void exercise_double_pointers(unsigned int** a) { ptr_ptr_return1((unsigned int**)a); ptr_ptr_return2((unsigned int**)a); @@ -188,7 +188,7 @@ ptr_ptr_return2_ExpectAndReturn(&pA, &pB); ptr_ptr_return3_ExpectAndReturn(&pA, &pB); ptr_ptr_return4_ExpectAndReturn(&pA, &pB); - exercise_double_pointers((unsigned int)(&pA)); + exercise_double_pointers((unsigned int**)(&pA)); } - :pass: TRUE