ThrowTheSwitch / Ceedling

Ruby-based unit testing and build system for C projects

Home Page:http://throwtheswitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ceedling is not able to find the toolchain includes by default

ChankyTheConqueror opened this issue · comments

I have set my MinGW path (C:\MinGW\bin) in the environment variables, and the toolchain configuration is commented out in project.yml. The compiler and linker seem to work normally if i just use my header files located under my include paths. However, when I include a header file like <time.h> located under C:\MinGW\include, it seems that Ceedling is not aware of it. I can confirm that this worked in earlier versions of Ceedling, specifically version 0.31.0. Currently, I am using the pre-release version 0.32.0-c67c010
The Ceedling version details are as follows:
Ceedling:: 0.32.0,
Unity:: 2.5.4, CMock:: 2.5.4,
CException:: 1.3.3

@ChankyTheConqueror Thanks for the report. 0.32 is a big set of changes. Can you explain a little bit more about what the behavior was before 0.31 and any associated configurations? Perhaps there is little else to say? Include statements for header files within the standard library just aren't working now but they previously were?

Could you perhaps capture any sort of before and after verbose output (verbosity[5] task before your test or release task)?

Certainly, previously it was quite simple. I just had to set up Ceedling according to the instructions in the field-manual-for-ceedling documentation. This included the installation instructions for MinGW, Ruby and much more, btw its a great book! Then Ceedling was able to intelligently locate the location of GCC and the compiler includes.

However, with version 0.32.0, you now need to additionally set the compiler bin path in the environment variables, so that GCC can be found. This allows Ceedling to at least know where the compiler is located, but it fails to find the includes. I suspect that the logic for building COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE has changed in version 0.32.0.

Is it possible to manually set COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE instead of specifying the entire toolchain in project.yaml?

OR

if gcc is found then set COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE to <path/to/gcc/bin/../include

Could this problem have been introduced with the introduction of the default compiler option "-nostdinc"? If yes how can i override this option?

Here is the verbose output:
`Verbose: exec(): gcc.exe -I"../../input/swc_bsw/core/_BSW_AUTOSAR/StbM" -I"../../input/swc_bsw/core/_BSW_AUTOSAR/Nm" -I"../../input/swc_bsw/core/_BSW_AUTOSAR/Csm" -I"../../input/swc_bsw/core/tm" -I"../../input/swc_bsw/core/util" -I"../../input/swc_bsw/core/chili_version" -I"../../input/swc_bsw/pjspec/crypto_if" -I"../../input/swc_bsw/pjspec/autosar_stack/integration/src" -I"../../input/swc_bsw/core/dcm" -I"../../input/swc_bsw/core/dem" -I"../../input/swc_bsw/core/edm" -I"../../input/swc_bsw/core/iem" -I"../../input/swc_bsw/core/inc/general" -I"../../input/swc_bsw/core/mcal/mcu" -I"../../input/swc_bsw/core/mcal/stm" -I"../../input/swc_bsw/core/ostm" -I"../../input/swc_bsw/core/util_mem" -I"../../input/swc_bsw/pjspec/autosar_stack/_BSW_AUTOSAR_cfg" -I"../../input/swc_bsw/pjspec/autosar_stack/integration/inc" -I"../../input/swc_bsw/pjspec/autosar_stack/swc_if/inc" -I"../../input/swc_bsw/pjspec/dem_cfg" -I"../../input/swc_bsw/pjspec/iem_cfg" -I"../../input/swc_bsw/pjspec/mcal_cfg/fls_cfg" -I"../../src/memory_placement/BSW" -I"../../src/memory_placement/RTE" -I"../../src/rte/cfg" -I"../../src/rte/generated" -I"test/support" -I"build/test/mocks/test_secoc_callout" -I"build/vendor/unity/src" -I"build/vendor/cmock/src" -D"TEST=1" -D"CORE_ASSOCIATION=0" -DGNU_COMPILER -g -c "test/test_secoc_callout.c" -o "build/test/out/test_secoc_callout/test_secoc_callout.o" -MMD -MF "build/test/dependencies/test_secoc_callout.d"

ERROR: Shell command failed.`

As you can see above the compiler includes are missing

Sorry i decided to search the function in the compiler includes it seems that the issue is that my mingw does not support the function im calling :-(. No issue here!!!