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

Test linking issue #904

Open
mdyme opened this issue Jul 11, 2024 · 8 comments
Open

Test linking issue #904

mdyme opened this issue Jul 11, 2024 · 8 comments

Comments

@mdyme
Copy link

mdyme commented Jul 11, 2024

Two tests are using the same mock file:

test_simple1.c:
...
#include "mock_function.c"
...

test_simple2.c:
...
#include "mock_function.c"
...

function.c id following:
#ifdef FUNCTION
void my_function() {};
#endif

These tests are using different set of defines in yml file:
...
:defines:
:test_simple1:
- *common_defines

:test_simple2
- *common_defines
- FUNCTION
...

When running these tests I have following linker issue:
...
Generating include list for mock_function.c
Creating mock for mock_function.c
Compiling mock_function.c
Linking test_simple1.elf
Running test_simple1.elf
...
Generating include list for mock_function.c
Creating mock for mock_function.c
Linking test_simple2.elf
test_simple2.o: undefined reference to `my_function_Stub'
...

When building test_simlpe2 step "Compiling mock_function.c" is missing. This causes linking issue. When running test_simple2 alone there is no linker issue.

Could not find in documentation how to enforce recompilation of all mocs for each test.

@mvandervoord
Copy link
Member

If you look into switching to the release candidate for Ceedling, this has already been fixed.

@mdyme
Copy link
Author

mdyme commented Jul 15, 2024

mvandervoord thank you for your quick response, we will consider this upgrade

@mdyme mdyme closed this as completed Jul 15, 2024
@mdyme
Copy link
Author

mdyme commented Oct 15, 2024

At this point we are not able to adapt our large project to all breaking changes for version 0.32_RC.
Could you provide information which commit is fixing this linking issue?

@mdyme mdyme reopened this Oct 15, 2024
@mvandervoord
Copy link
Member

This isn't a feature we're considering backporting to the previous release. The entire structure of how dependency tracking and per-file compilation options changed in order to support this.

@mdyme
Copy link
Author

mdyme commented Oct 16, 2024

Ok, got it. What Ruby version is recommended for 0.32_RC?

@ckielstra
Copy link

From the release notes:
Ceedling now runs in Ruby3. This latest version of Ceedling is not backwards compatible with earlier versions of Ruby.

@mdyme
Copy link
Author

mdyme commented Oct 18, 2024

Thanks for your answers.

Probably it should be reported under another issue, but when running 0.32_RC with Ruby3.3 I have:

ceedling test:my_test
<internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- constructor (LoadError)
Did you mean?  ostruct
        from <internal:C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from C:/my_project_path/ceedling/ceed_ws//vendor/ceedling/bin/ceedling:24:in `<main>'
Failed: ceedling test:my_test

The same for Ruby 3.2.

On Ruby 3.0 I have different issue related with vendor version:

ceedling test:my_test
Loaded project configuration from environment variable `CEEDLING_PROJECT_FILE`.
 > Using: C:/my_project_path/ceedling/generic.yml
 > Working directory: C:/my_project_path/ceedling

EXCEPTION: Could not collect version information for vendor component: C:/workspace/gitwork/Ceedling/vendor/unity/src/unity.h
Failed: ceedling test:my_test

Any suggestions how to handle these issues? Couldn't find anything interesting in Ceedling's documentation, or I checked wrong .md files.

@Letme
Copy link

Letme commented Oct 18, 2024

I think Mark wanted to you change to 1.0.0 pre-releases, not 0.32_RC. I also suggest you compare your project.yml with generated project.yml when you would start a new project, because there are some differences between 0.31 and 1.0.0.

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

4 participants