Skip to content

WIP: Introspection APIs (#366)#378

Draft
eschaton wants to merge 13 commits into
libcheck:masterfrom
eschaton:eschaton/introspection-api
Draft

WIP: Introspection APIs (#366)#378
eschaton wants to merge 13 commits into
libcheck:masterfrom
eschaton:eschaton/introspection-api

Conversation

@eschaton

@eschaton eschaton commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Adding introspection APIs for test suite runners, suites, test cases, and tests.

eschaton added 7 commits July 2, 2026 20:52
Set tab_width to 8, indent_size to 4, and indent_style to space.
For consistency with other API, `tcase_name()` now takes a TCase and returns
its name, rather than returning the name of the currently-running TCase. The
currently-running TCase is exposed by a new API, `tcase_current()`.

This also required changing the `tcase_fn_start()` internal function to take
the currently-running TCase, so I also took the opportunity to rename it to
`_tcase_fn_start()` so that it's clearly an exposed internal function.
@eschaton eschaton self-assigned this Jul 3, 2026
@eschaton eschaton marked this pull request as draft July 3, 2026 05:15
@eschaton eschaton linked an issue Jul 3, 2026 that may be closed by this pull request
@eschaton

eschaton commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Anyone have any idea what the test failures here might be, based on eyeballing my commits? I expect it's related to my change to make test_name() take a TCase (so tcase_current() is needed to get the current one within a test).

@eschaton eschaton requested a review from brarcher July 3, 2026 05:23
eschaton added 6 commits July 3, 2026 22:35
For consistency with other API, `tcase_name()` now takes a TCase and returns
its name, rather than returning the name of the currently-running test case.
The name of the currently-running test case is exposed by a new API,
`tcase_current_name()`.
Since it's an exposed internal function, `tcase_fn_start()` should be
`_tcase_fn_start()` instead.
@eschaton eschaton force-pushed the eschaton/introspection-api branch from 59ea0dc to 28d0c7c Compare July 4, 2026 05:36
@eschaton

eschaton commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Turns out one just can't rely on being able to get a filled-in TCase during test execution, so instead of using tcase_name(tcase_current()) I've just added tcase_current_name() so tcase_name() can still take a TCase *.

@eschaton

eschaton commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Remaining to-do items:

  • A few documentation comments for new API
  • Tests for new API

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.

Introspection APIs

1 participant