Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

Header modifications not parsed

Open lesavonfou opened this issue 7 years ago • 5 comments

I am running into a strange problem that I can reproduce with the blinky example. Header/include modifications are not taken in account in the next build. if I only modify BlinkTask.h as such:

#ifndef BlinkTask_H
#define BlinkTask_H
sfsdfsdfsf
void BlinkTask(void);
#endif

This changes are not detected by ceedling and naturally does not recompile BlinkTask.c. The only work around I found was to cleanup the build folder with rake clobber and then relaunch the building process.

This issue can be pretty annoying!

I am running Linux but I can also reproduce in a Windows system.

lesavonfou avatar Jul 10 '18 11:07 lesavonfou

In ceedling, the pre-processing stage is performed once. I added support to make different compilation options for different test files. It is already merged and you should see the expected behaviour. For setting this kind of pre-processing tests do the following steps:

:defines:
  :commmon: &common_defines
      - DEFINE_A
      - DEFINE_B
  :test: &test_defines
      - *common_defines
      - TEST
    :test_preprocess: 
      - *common_defines
      - TEST
    :test_<specific_test>:
      - *test_defines
      - BlinkTask_H

The defines on :common_defines: should be in all the defines, as the definition of the tests "inherit" the defines on group common_defines For the specific test where we are going to have the common_defines, the test_defines and the BlinkTask_H file.

I hope this is useful for you.

methril avatar Aug 07 '18 11:08 methril

I am currently running into the same issue and the fix does not seem to work for me.

Simply put, the header file modifications are never detected. For example, I modify an enumeration to something entirely different. If I try to compile the source file, errors are detected. The modified enumeration is now undefined. Ceedling does not detect these modifications and running the tests again result in a full pass, which is obviously wrong.

Either you manually do a meaningless modification in the source file to force Ceedling to detect the header changes as well or, as @lesavonfou said, you clobber everything, then relaunch.

As for the fix, I modified my project.yml defines section to include the header define for the test_<specific_test>, exactly as explained by @methril, but the behavior remains the same. I might be misunderstanding something or expecting Ceedling to behave a way it shouldn't, if so please tell me.

This issue is still very much there and actually quite bothersome in my experience.

INTNEP2 avatar Jan 22 '19 18:01 INTNEP2

I think it is somehow related to my issue #369. @INTNEP2 Did you solve this problem? Can you check if fixes on my branch can help to solve your problem?

CezaryGapinski avatar Sep 22 '19 10:09 CezaryGapinski

Did you enabled the enable the pre-processor on the project.yml?

:project:
  :use_test_preprocessor: TRUE

methril avatar Aug 19 '20 20:08 methril

Setting use_deep_dependencies: TRUE solved the problem for me!

peteman720 avatar Mar 15 '23 18:03 peteman720