mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-29 14:29:58 +00:00
Support alternative header file extension support (thanks @Tuc-an)
This commit is contained in:
@@ -61,7 +61,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile|
|
||||
generator = UnityTestRunnerGenerator.new
|
||||
|
||||
# headers that begin with prefix or end with suffix are not included
|
||||
all_headers = Dir["#{SRC_DIR}/**/*.h"]
|
||||
all_headers = Dir["#{SRC_DIR}/**/*.h*"]
|
||||
|
||||
def reject_mock_files(file)
|
||||
extn = File.extname file
|
||||
@@ -104,8 +104,8 @@ File.open(TEST_MAKEFILE, "w") do |mkfile|
|
||||
linkonly = cfg[:includes][:linkonly]
|
||||
linkonly_objs = []
|
||||
linkonly.each do |linkonlyfile|
|
||||
linkonlybase = File.basename(linkonlyfile)
|
||||
linkonlymodule_src = File.join(SRC_DIR, "#{linkonlyfile}.c")
|
||||
linkonlybase = File.basename(linkonlyfile,".*")
|
||||
linkonlymodule_src = File.join(SRC_DIR, "#{linkonlyfile}")
|
||||
linkonlymodule_obj = File.join(OBJ_DIR, "#{linkonlybase}.o")
|
||||
linkonly_objs.push(linkonlymodule_obj)
|
||||
#only create the target if we didn't already
|
||||
@@ -175,7 +175,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile|
|
||||
# Generate and build mocks
|
||||
all_headers_to_mock.each do |hdr|
|
||||
mock_name = MOCK_PREFIX + File.basename(hdr, '.*')
|
||||
mock_header = File.join(MOCKS_DIR, mock_name + '.h')
|
||||
mock_header = File.join(MOCKS_DIR, mock_name + File.extname(hdr))
|
||||
mock_src = File.join(MOCKS_DIR, mock_name + '.c')
|
||||
mock_obj = File.join(MOCKS_DIR, mock_name + '.o')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user