Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated source files from :pre_build: command hook aren't compiled #959

Open
alofthouse opened this issue Nov 27, 2024 · 1 comment
Open

Comments

@alofthouse
Copy link

Hi,

Firstly, I want to say thanks for all your work on Ceedling.

I have a (probably niche) issue when using Ceedling with the command_hooks plugin, specifically with the pre_build hook.

Due to the nature of the project, we have some source files (.c and .h) that need to be generated before running our tests. I've setup a command hook which just calls a script to generate these files. They are created in the test/support folder.

:command_hooks:
  :pre_build:
    :executable: cmd.exe
    :arguments:
      - /c
      - "scripts\\pre_build.bat"

This all works as expected and the hook runs successfully. However, it appears that Ceedling generates its list of source/support files before the pre_build hook is run. This means that the generated files aren't compiled as they weren't picked up earlier.

This only happens the first time you run the Ceedling project with a clean repository. By the second time you run it, then the source files have already been generated, and everything works as expected.

Without being familiar with the code base, an easy fix for this seems to be just to move the invocation of the pre_build hook to somewhere closer to Ceedling starting up.

Thanks,
Adam


Environment:

  • Windows 11
  • Ceedling Version:
ceedling version
Welcome to Ceedling!

  Ceedling => 1.0.0-f899db8
  ----------------------
  C:/tools/ruby33/lib/ruby/gems/3.3.0/gems/ceedling-1.0.0/

  Build Frameworks
  ----------------------
       CMock => 2.6.0
       Unity => 2.6.0
  CException => 1.3.4
@claudiiolima
Copy link

claudiiolima commented Dec 12, 2024

I am having the same issue too, but using pre_release on command_hooks plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants