Skip to content

ctest: test ctest-next in ctest-test #4558

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbyx
Copy link
Contributor

@mbyx mbyx commented Jul 18, 2025

Description

  • Adds support for testing ctest-next using the same test crate as ctest.
  • Additionally fixes some bugs in the template (unnecessary unsafe, and missing c_char import).
  • Removes tests for &str, they can be added back in with separate constants that are skipped by ctest-next if needed.
  • Adds link_name support for functions and statics, which goes unused right now but will be used when tests for functions and statics are implemented.
  • Removes the dependency on libc, as ctest-next cannot resolve it (can be fixed later, although it isn't really necessary anywhere)

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot rustbot added ctest Issues relating to the ctest crate S-waiting-on-review labels Jul 18, 2025
@mbyx mbyx force-pushed the ctest-test-port-minimal branch from adf53e7 to bab7d0b Compare July 18, 2025 16:17
@mbyx
Copy link
Contributor Author

mbyx commented Jul 18, 2025

Unfortunately, I have no idea what the errors mean.

@tgross35
Copy link
Contributor

Unfortunately, I have no idea what the errors mean.

Can you try updating the templates to change extern "C" { ... } to unsafe extern "C" { ... }? that's a recent edition change

@mbyx mbyx force-pushed the ctest-test-port-minimal branch from bab7d0b to 5da155d Compare July 19, 2025 17:23
@mbyx
Copy link
Contributor Author

mbyx commented Jul 19, 2025

Fixes the previous error, but a new one pops up, looks like it's a mix of forgetting to ignore 2024 edition crates for targets that don't support it, and the fact that the old ctest cannot parse new syntax.

If we want to keep both we'll probably have to keep them separate as they were before. The edition was changed to 2024 since ctest-next is a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctest Issues relating to the ctest crate S-waiting-on-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants