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

Ceedling fails to find header file #933

Open
MichaelBMiner opened this issue Sep 20, 2024 · 0 comments
Open

Ceedling fails to find header file #933

MichaelBMiner opened this issue Sep 20, 2024 · 0 comments

Comments

@MichaelBMiner
Copy link

MichaelBMiner commented Sep 20, 2024

Hello,

I have been struggling with this for a bit now. I am trying to mock some headers for an NXP part MCXA154, there is a file fsl_romapi.h. This includes a few other headers as well.
project.txt

I have attached my project.yml

My basic test is

#ifdef CEEDLING_TESTS

#include "unity.h"
#include "flash_storage.h"

#include "mock_MCXA153_features.h"
#include "mock_fsl_common.h"
#include "mock_fsl_romapi.h"
#include "mock_fsl_device_registers.h"
#include "mock_fsl_common_arm.h"
#include "mock_fsl_reset.h"
#include "mock_fsl_clock.h"

void setUp(void) {

}

void tearDown(void) {

}

void test_flash_storage_init_success(void) {
    flash_config_t flashDriver;
    FLASH_Init_ExpectAndReturn(&flashDriver, kStatus_Success);

    status_t status = flash_storage_init();

    TEST_ASSERT_EQUAL(kStatus_Success, status);
}

#endif

In my ceedling output I see

Creating mock for fsl_common...
Creating mock for fsl_romapi...
Creating mock for fsl_device_registers...
WARNING: No function prototypes found!
Creating mock for fsl_common_arm...
In file included from include/flash_storage.h:12,
from test/test_flash_storage.c:5:
build/test/mocks/fsl_romapi.h:1:10: fatal error: frdm-mcxa153-bsp/drivers/fsl_common.h: No such file or directory
1 | #include "frdm-mcxa153-bsp/drivers/fsl_common.h"

All of my mocks are linking to the full file path rather than the relative paths. I am attaching pictures of my folder structure.

image
image

Running an ls command from the same directory I run ceedling from I get

ls frdm-mcxa153-bsp/drivers/fsl_common*
frdm-mcxa153-bsp/drivers/fsl_common_arm.c frdm-mcxa153-bsp/drivers/fsl_common_arm.h frdm-mcxa153-bsp/drivers/fsl_common.c frdm-mcxa153-bsp/drivers/fsl_common.h

Notice the files that cannot be found are there.

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

1 participant