diff --git a/config/production_environment.rb b/config/production_environment.rb index cf895f4..5ea2a5b 100644 --- a/config/production_environment.rb +++ b/config/production_environment.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== # Setup our load path: [ diff --git a/config/test_environment.rb b/config/test_environment.rb index 45378d7..728e5e6 100644 --- a/config/test_environment.rb +++ b/config/test_environment.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== # Setup our load path: [ diff --git a/docs/CMock Summary.odt b/docs/CMock Summary.odt index 970c7f6..1071061 100644 Binary files a/docs/CMock Summary.odt and b/docs/CMock Summary.odt differ diff --git a/docs/CMock Summary.pdf b/docs/CMock Summary.pdf index d4ad97a..55faaeb 100644 Binary files a/docs/CMock Summary.pdf and b/docs/CMock Summary.pdf differ diff --git a/lib/cmock.rb b/lib/cmock.rb index 821e375..a97fd66 100644 --- a/lib/cmock.rb +++ b/lib/cmock.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../config/production_environment" require "cmock_header_parser" diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index 9517a89..088c322 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== class CMockConfig diff --git a/lib/cmock_file_writer.rb b/lib/cmock_file_writer.rb index aac2424..efbef61 100644 --- a/lib/cmock_file_writer.rb +++ b/lib/cmock_file_writer.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== class CMockFileWriter diff --git a/lib/cmock_generator.rb b/lib/cmock_generator.rb index 9466f78..cbe415d 100644 --- a/lib/cmock_generator.rb +++ b/lib/cmock_generator.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + $here = File.dirname __FILE__ class CMockGenerator diff --git a/lib/cmock_generator_plugin_array.rb b/lib/cmock_generator_plugin_array.rb index 91c5725..128197d 100644 --- a/lib/cmock_generator_plugin_array.rb +++ b/lib/cmock_generator_plugin_array.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + class CMockGeneratorPluginArray attr_reader :priority diff --git a/lib/cmock_generator_plugin_callback.rb b/lib/cmock_generator_plugin_callback.rb index b463541..ea0dbe7 100644 --- a/lib/cmock_generator_plugin_callback.rb +++ b/lib/cmock_generator_plugin_callback.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + class CMockGeneratorPluginCallback attr_reader :priority diff --git a/lib/cmock_generator_plugin_cexception.rb b/lib/cmock_generator_plugin_cexception.rb index 0199737..b490bed 100644 --- a/lib/cmock_generator_plugin_cexception.rb +++ b/lib/cmock_generator_plugin_cexception.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + class CMockGeneratorPluginCexception attr_reader :priority diff --git a/lib/cmock_generator_plugin_expect.rb b/lib/cmock_generator_plugin_expect.rb index 5991a4f..ce395c9 100644 --- a/lib/cmock_generator_plugin_expect.rb +++ b/lib/cmock_generator_plugin_expect.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== class CMockGeneratorPluginExpect diff --git a/lib/cmock_generator_plugin_ignore.rb b/lib/cmock_generator_plugin_ignore.rb index 6936253..b072d57 100644 --- a/lib/cmock_generator_plugin_ignore.rb +++ b/lib/cmock_generator_plugin_ignore.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== class CMockGeneratorPluginIgnore diff --git a/lib/cmock_generator_utils.rb b/lib/cmock_generator_utils.rb index 71f948c..48796d0 100644 --- a/lib/cmock_generator_utils.rb +++ b/lib/cmock_generator_utils.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== class CMockGeneratorUtils diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index b3385df..529f21d 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + class CMockHeaderParser attr_accessor :funcs, :c_attributes, :treat_as_void @@ -56,8 +62,9 @@ class CMockHeaderParser # remove assembler pragma sections source.gsub!(/^\s*#\s*pragma\s+asm\s+.*?#\s*pragma\s+endasm/m, '') - # remove preprocessor statements + # remove preprocessor statements and extern "C" source.gsub!(/^\s*#.*/, '') + source.gsub!(/extern\s+\"C\"\s+\{/, '') # enums, unions, structs, and typedefs can all contain things (e.g. function pointers) that parse like function prototypes, so yank them # forward declared structs are removed before struct definitions so they don't mess up real thing later. we leave structs keywords in function prototypes diff --git a/lib/cmock_plugin_manager.rb b/lib/cmock_plugin_manager.rb index f82f55e..3b37ac5 100644 --- a/lib/cmock_plugin_manager.rb +++ b/lib/cmock_plugin_manager.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== class CMockPluginManager diff --git a/lib/cmock_unityhelper_parser.rb b/lib/cmock_unityhelper_parser.rb index c976765..fd44a7f 100644 --- a/lib/cmock_unityhelper_parser.rb +++ b/lib/cmock_unityhelper_parser.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + class CMockUnityHelperParser attr_accessor :c_types diff --git a/rakefile.rb b/rakefile.rb index 2e62db3..19e5494 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + HERE = File.expand_path(File.dirname(__FILE__)) + '/' require HERE + 'config/test_environment' diff --git a/rakefile_helper.rb b/rakefile_helper.rb index ac6aa93..cdb59c8 100644 --- a/rakefile_helper.rb +++ b/rakefile_helper.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require 'yaml' require 'fileutils' require 'generate_test_runner' diff --git a/src/cmock.c b/src/cmock.c index c52c266..e46e1e3 100644 --- a/src/cmock.c +++ b/src/cmock.c @@ -1,3 +1,9 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #include "unity.h" #include "cmock.h" diff --git a/src/cmock.h b/src/cmock.h index 38935ae..e8a0854 100644 --- a/src/cmock.h +++ b/src/cmock.h @@ -1,3 +1,9 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #ifndef CMOCK_FRAMEWORK_H #define CMOCK_FRAMEWORK_H diff --git a/test/c/TestCMockC.c b/test/c/TestCMockC.c index 4917bfb..7062d94 100644 --- a/test/c/TestCMockC.c +++ b/test/c/TestCMockC.c @@ -1,3 +1,9 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #include "unity.h" #include "cmock.h" diff --git a/test/c/TestCMockCDynamic.c b/test/c/TestCMockCDynamic.c index 556441c..2c100c1 100644 --- a/test/c/TestCMockCDynamic.c +++ b/test/c/TestCMockCDynamic.c @@ -1,3 +1,9 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #include "unity.h" #include "cmock.h" diff --git a/test/c/TestCMockCDynamic_Runner.c b/test/c/TestCMockCDynamic_Runner.c index a811419..230318f 100644 --- a/test/c/TestCMockCDynamic_Runner.c +++ b/test/c/TestCMockCDynamic_Runner.c @@ -1,4 +1,9 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #include "unity.h" #include #include diff --git a/test/c/TestCMockC_Runner.c b/test/c/TestCMockC_Runner.c index bb809b2..07e9aa0 100644 --- a/test/c/TestCMockC_Runner.c +++ b/test/c/TestCMockC_Runner.c @@ -1,4 +1,9 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #include "unity.h" #include #include diff --git a/test/system/systest_generator.rb b/test/system/systest_generator.rb index 2c4b686..fa4a452 100644 --- a/test/system/systest_generator.rb +++ b/test/system/systest_generator.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + SYS_TEST_GEN_ROOT = File.expand_path( File.dirname( __FILE__ ) ) + '/' require 'yaml' diff --git a/test/system/test_compilation/const.h b/test/system/test_compilation/const.h index ab56018..e17c465 100644 --- a/test/system/test_compilation/const.h +++ b/test/system/test_compilation/const.h @@ -1,3 +1,8 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ struct _DUMMY_T { unsigned int a; float b; }; diff --git a/test/system/test_compilation/osek.h b/test/system/test_compilation/osek.h index b6e3b4b..4271e67 100755 --- a/test/system/test_compilation/osek.h +++ b/test/system/test_compilation/osek.h @@ -1,3 +1,9 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + typedef unsigned char OSServiceIdType; typedef void (*OSEKOS_VOIDFUNCPTR)(void); diff --git a/test/system/test_compilation/parsing.h b/test/system/test_compilation/parsing.h index 8d5becc..e1bcb8b 100644 --- a/test/system/test_compilation/parsing.h +++ b/test/system/test_compilation/parsing.h @@ -1,3 +1,8 @@ +/* ========================================== + CMock Project - Automatic Mock Generation for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ typedef unsigned short U16; typedef signed int int32_t; diff --git a/test/system/test_interactions/parsing_challenges.yml b/test/system/test_interactions/parsing_challenges.yml index d2e9cdb..e64f69c 100644 --- a/test/system/test_interactions/parsing_challenges.yml +++ b/test/system/test_interactions/parsing_challenges.yml @@ -23,7 +23,9 @@ #include "NonExistantFile.h */ //#include "AndIgnoreThisToo.h" - + #ifdef __cplusplus + extern "C" { + #endif #define SHOULD_IGNORE_NEXT_FUNC_DEF_AS_PART_OF_MACRO \ void IgnoredFunction(NotAValidType ToMakeItFailIfWeActuallyMockedThis); @@ -60,6 +62,9 @@ void oh_brackets1(int fudge[5]); void oh_brackets2(int caramel[]); + #ifdef __cplusplus + } + #endif :source: :header: | diff --git a/test/test_helper.rb b/test/test_helper.rb index fbd54df..0b61af5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../config/test_environment" #gem install test-unit -v 1.2.3 diff --git a/test/unit/cmock_config_test.rb b/test/unit/cmock_config_test.rb index 4ea80c2..04007e5 100644 --- a/test/unit/cmock_config_test.rb +++ b/test/unit/cmock_config_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_config' diff --git a/test/unit/cmock_file_writer_test.rb b/test/unit/cmock_file_writer_test.rb index 532b9ef..604e46c 100644 --- a/test/unit/cmock_file_writer_test.rb +++ b/test/unit/cmock_file_writer_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_file_writer' diff --git a/test/unit/cmock_generator_main_test.rb b/test/unit/cmock_generator_main_test.rb index 60d6fe8..b9492a5 100644 --- a/test/unit/cmock_generator_main_test.rb +++ b/test/unit/cmock_generator_main_test.rb @@ -1,3 +1,8 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== $ThisIsOnlyATest = true diff --git a/test/unit/cmock_generator_plugin_array_test.rb b/test/unit/cmock_generator_plugin_array_test.rb index 2722c14..5a9ad07 100644 --- a/test/unit/cmock_generator_plugin_array_test.rb +++ b/test/unit/cmock_generator_plugin_array_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_generator_plugin_array' diff --git a/test/unit/cmock_generator_plugin_callback_test.rb b/test/unit/cmock_generator_plugin_callback_test.rb index a0a06f8..553664d 100644 --- a/test/unit/cmock_generator_plugin_callback_test.rb +++ b/test/unit/cmock_generator_plugin_callback_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_generator_plugin_callback' diff --git a/test/unit/cmock_generator_plugin_cexception_test.rb b/test/unit/cmock_generator_plugin_cexception_test.rb index 35c6554..eb0a298 100644 --- a/test/unit/cmock_generator_plugin_cexception_test.rb +++ b/test/unit/cmock_generator_plugin_cexception_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_generator_plugin_cexception' diff --git a/test/unit/cmock_generator_plugin_expect_test.rb b/test/unit/cmock_generator_plugin_expect_test.rb index 1c778e5..e905221 100644 --- a/test/unit/cmock_generator_plugin_expect_test.rb +++ b/test/unit/cmock_generator_plugin_expect_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_generator_plugin_expect' diff --git a/test/unit/cmock_generator_plugin_ignore_test.rb b/test/unit/cmock_generator_plugin_ignore_test.rb index 885c859..641e67c 100644 --- a/test/unit/cmock_generator_plugin_ignore_test.rb +++ b/test/unit/cmock_generator_plugin_ignore_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_generator_plugin_ignore' diff --git a/test/unit/cmock_generator_utils_test.rb b/test/unit/cmock_generator_utils_test.rb index 35976c5..ae85dfd 100644 --- a/test/unit/cmock_generator_utils_test.rb +++ b/test/unit/cmock_generator_utils_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_generator_utils' diff --git a/test/unit/cmock_header_parser_test.rb b/test/unit/cmock_header_parser_test.rb index 2ce97df..446e128 100644 --- a/test/unit/cmock_header_parser_test.rb +++ b/test/unit/cmock_header_parser_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + $ThisIsOnlyATest = true require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" diff --git a/test/unit/cmock_plugin_manager_test.rb b/test/unit/cmock_plugin_manager_test.rb index dda10ef..eb972b7 100644 --- a/test/unit/cmock_plugin_manager_test.rb +++ b/test/unit/cmock_plugin_manager_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_plugin_manager' diff --git a/test/unit/cmock_unityhelper_parser_test.rb b/test/unit/cmock_unityhelper_parser_test.rb index cdae738..03c7be1 100644 --- a/test/unit/cmock_unityhelper_parser_test.rb +++ b/test/unit/cmock_unityhelper_parser_test.rb @@ -1,3 +1,9 @@ +# ========================================== +# CMock Project - Automatic Mock Generation for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_unityhelper_parser'