mardi 31 mai 2016

CMock additional include via CLI

Introducing CMock on top of Unity into our build system (based on make) I keep struggeling with the correct handing over of additional include headers to cmock. We don't want to use configuration YML files since we like to have all config stuff within our Makefiles. Thus I am stuck with handing over all configs zu the cmock ruby script when calling it by CLI arguments. This works with the mock_prefix and the mock_path. Handing over the aray containing the additional include headers fails as of now. Here's what the call within the Makefile looks like:

CMOCK_MOCKS_DIR     = $(THIS_DIR)/sr/mocks
CMOCK_MOCKS_PREFIX  = mock_
CMOCK_ARGS         += --mock_path="$(strip $(CMOCK_MOCKS_DIR))"
CMOCK_ARGS         += --mock_prefix="$(strip $(CMOCK_MOCKS_PREFIX))"
CMOCK_ARGS         += --includes="qep.h, qep_port.h, qp_port.h"

mock:
    $(Q) $(MKDIR) $(strip $(CMOCK_MOCKS_DIR))
    ruby $(strip $(CMOCK_DIR))/cmock.rb $(CMOCK_ARGS) $(MOCK_HEADERS)

Which results in this call on the shell

ruby C:/cmock/lib/cmock.rb --mock_path="C:/unittest/src/mocks" --mock_prefix="mock_" --includes="qep.h, sp_core.h, sp_osapi.h" qf.h
WARNING: :includes should be an array.

Handing over the configuration as YML works with several include headers given inside. Also configuring a single additional include header by usage of CLI also works, only passing more than one file fails. Does anybody have experience with handing over an array to cmock?

Thanks for the support!

Aucun commentaire:

Enregistrer un commentaire