ctest: Figure out a way to test anonymous structs/unions

Open
#4,650 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
testing-qa

Research direction

Start with the ctest-related discussion in issue #4650 and the linked pull request discussion. Determine how anonymous struct and union fields should be identified through cfg, and define how ctest should inline the relevant tests. Done means the approach is implemented and anonymous-field tests are exercised without relying on the rejected tricky regex pattern.

Written by the indexing model from the issue text.

Description

ctest

We should provide a cfg way to identify a union or struct field as anonymous. This can probably be a is_field_anonymous function that would make ctest "inline" the relevant tests.

This discussion was started at https://github.com/rust-lang/libc/pull/4610#discussion_r2272226633 but I don't think we actually need that tricky regex pattern.

Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/libc

All issues in rust-lang/libc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.