Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

rake aborts when space between "#" and "include" for mock

Open gsmithufl opened this issue 3 years ago • 2 comments

If I include a mock with spaces between # and include it seems to fail. Removing the spaces fixes it. We would have spaces if we have a clang-format option to nest preprocessor directives.

#  include "mock_some_file.h"
test-unit/test_something.c:53:12: fatal error: mock_some_file.h: No such file or directory
   53 | #  include "mock_some_file.h"
      |            ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ERROR: Shell command failed.

rake aborted!
ShellExecutionException: ShellExecutionException
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/tool_executor.rb:82:in `exec'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/preprocessinator_file_handler.rb:12:in `preprocess_file'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/preprocessinator.rb:40:in `preprocess_file'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/preprocessinator.rb:12:in `block in setup'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/preprocessinator_helper.rb:33:in `preprocess_test_file'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/preprocessinator.rb:25:in `preprocess_test_and_invoke_test_mocks'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/test_invoker.rb:89:in `block in setup_and_invoke'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/test_invoker.rb:63:in `each'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/test_invoker.rb:63:in `setup_and_invoke'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/lib/ceedling/rules_tests.rake:71:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/bin/ceedling:311:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.3/gems/ceedling-0.28.3/bin/ceedling:298:in `<top (required)>'
/usr/local/ruby/latest/bin/ceedling:23:in `load'
/usr/local/ruby/latest/bin/ceedling:23:in `<main>'

gsmithufl avatar Apr 21 '21 14:04 gsmithufl

Hi

If you are interested, I created pull request with fix for your problem. https://github.com/ThrowTheSwitch/Ceedling/pull/593

It works for me so I have hope it will works as well for you.

lukzeg avatar May 18 '21 21:05 lukzeg

Hi @gsmithufl,

Can you look at the latest master of ceedling and double check if the problem appears in your code? If no, can we close this issue?

Kind Regards, Lucas

lukzeg avatar Jan 03 '23 08:01 lukzeg