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

cxx-qt-gen: add support for passing in CfgEvaluator #1168

Merged
merged 12 commits into from
Feb 5, 2025

Conversation

ahayzen-kdab
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c8409c7) to head (729a56e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #1168    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           71        73     +2     
  Lines        11882     12426   +544     
==========================================
+ Hits         11882     12426   +544     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahayzen-kdab ahayzen-kdab force-pushed the 1133-cfg-evaluator-2 branch 2 times, most recently from 9e223b7 to 3fe67ce Compare January 28, 2025 12:09
@ahayzen-kdab ahayzen-kdab marked this pull request as ready for review January 28, 2025 12:22
Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work overall.
I thinkg this is lacking a snapshot test though, so it's easier to see where cfg attributes are now enabled and how that changes the generation.
Also, cfg attributes on QObject/QEnum don't seem to be respected yet.

We're also missing a CHANGELOG entry 😉

crates/cxx-qt-gen/src/generator/cfg.rs Outdated Show resolved Hide resolved
crates/cxx-qt-gen/src/generator/cfg.rs Outdated Show resolved Hide resolved
crates/cxx-qt-gen/src/generator/cfg.rs Outdated Show resolved Hide resolved
crates/cxx-qt-gen/src/syntax/cfg.rs Show resolved Hide resolved
crates/cxx-qt-gen/src/lib.rs Show resolved Hide resolved
@ahayzen-kdab ahayzen-kdab force-pushed the 1133-cfg-evaluator-2 branch 5 times, most recently from 9359ce5 to fe7f8a2 Compare January 31, 2025 17:25
Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test output looks pretty good.
Enabled items on disabled types may still be an issue.
They will fail to compile, which is expected, but the error messages are likely to be cryptic.

If there is an easy way to give a nicer error message we should probably do so.
However, if it's hard to give a good error message, we can keep it as-is.

crates/cxx-qt-gen/test_outputs/cfgs.h Show resolved Hide resolved
crates/cxx-qt-gen/test_outputs/cfgs.cpp Show resolved Hide resolved
@LeonMatthesKDAB LeonMatthesKDAB enabled auto-merge (squash) February 5, 2025 09:18
@LeonMatthesKDAB LeonMatthesKDAB merged commit 90039d7 into KDAB:main Feb 5, 2025
16 checks passed
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

Successfully merging this pull request may close these issues.

2 participants