ElectronVector / fake_function_framework

A plug-in for Ceedling to use the Fake Function Framework (fff) for mocking instead of Cmock.
MIT License
36 stars 13 forks source link

Getting fatal error: fff.h: No such file or directory #9

Closed tslator closed 6 years ago

tslator commented 6 years ago

I enabled the plugin but there is no fff.h file in the plugin directory. Do I need to download FFF separately in addition to enabling the plugin?

hugocura commented 6 years ago

I'm with exactly same problem, with my test code and even with plugin example. If the output of this include is removed from generator file (fff_mock_generator.rb), we can see that there are some other problems.

Is this project dead? I think the way this fff deals with mocking is far better than cmock, comparing with some professional tools already used.

mchernosky commented 6 years ago

Argh! I apologize for not being responsive here -- I didn't realize anyone else was really using it. I like fff a lot too, and try to get this issue fixed soon. Looks like there a few pull requests I need to check out too.

mchernosky commented 6 years ago

So the problem is that the vendor folder from this repo (which is where the fff.h file is supposed to go) isn't in the latest version (0.28.2) of the Ceedling gem, so any Ceedling projects created with this version of the gem will have this error. I'm not exactly sure why this is -- I checked out the Ceedling repo and built the gem myself and it was in there.

The quickest fix is to create a path in your project: vendor/ceedling/plugins/fake_function_framework/vendor/fff, and put the fff.h file in there.

You could revert to Ceedling version 0.28.1, but that is only going to affect any new projects you make with it.

I'm hoping that the next Ceedling release won't have this problem, because I can't see any obvious reason for it to have happened.

ataulien commented 6 years ago

Looks like you just need to do a recursive clone, since fff is imported as a git-submodule:

git clone --recursive https://github.com/ElectronVector/fake_function_framework.git

If you already cloned it without the --recursive-flag, you can do this:

git submodule update --init

You should update the README.md accordingly after you verified that this was the issue.

mchernosky commented 6 years ago

Updated the readme to specify a recursive clone in b05a1cd6d03092747f6f0a76bf625e0355485c91.

mchernosky commented 6 years ago

More details!

If you're still having this problem, and you've installed the most up-to-date version of this plugin in your project folder (in vendor/ceedling/plugins), you might want to check the :load_paths: setting in your project.yml file. You want it to look like this:

:plugins:
  :load_paths:
    - vendor/ceedling/plugins

The default may be #{Ceedling.load_path} which will attempt to load the plugin from your Ceedling installation folder... which probably has the broken version without the fff.h file.