rust-lang / rust-lang/libc

ctest: change API of when to skip

Open
#4,122 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-testsuite ctest
Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

Currently our config looks a bit like this:

    cfg.skip_field(move |struct_, field| {
        (struct_ == "siginfo_t" && field == "_pad") ||
        (musl && struct_ == "glob_t" && field == "gl_flags") ||
        // ...
    });

A problem is that we have no validation that e.g. _pad actually exists in siginfo_t. It would be better to have something like the following:

cfg.skip_field(&[
    // format: `(struct, field, extra_condition)`
    ("siginfo_t", "_pad", true),
    ("glob_t", "gl_flags", musl),
])

This would skip if any any of the entries match struct and field, and the condition for that row is true. However, it could also warn if any of those items are never used meaning the struct or field don't exist.

Contributor guide

Open the contributing guide

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.

Research direction

Start from the existing ctest skip_field API and the configuration call sites shown in the issue. Define the replacement entry format and ensure unused struct/field entries can be warned about; done means matching conditional entries are skipped and missing entries are reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.