GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add TEST_PROPERTY macro for JUnit per-test-case properties by thetic · Pull Request #1884 · cpputest/cpputest

Conversation

@thetic

@thetic thetic commented Apr 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • Adds TEST_PROPERTY(name, value) (C++) and TEST_PROPERTY_C(name, value) (C) macros that attach key-value string properties to the current test case
  • Properties appear as <properties><property name="..." value="..."/></properties> inside the <testcase> element in JUnit XML output (standard JUnit XML format); the block is omitted entirely when no properties are set
  • Property names and values are XML-encoded

The feature routes through the existing UtestShell → TestResult → TestOutput call chain: JUnitTestOutput overrides printTestProperty to store properties on per-test-case result nodes and emit them when writing XML. All other TestOutput subclasses get a default no-op, but the feature is available to extend existing or future output implementations.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sillocan reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
thetic added 4 commits March 31, 2026 21:18
@thetic
Add TEST_PROPERTY macro for JUnit per-test-case properties
e966f02
Adds TEST_PROPERTY(name, value) for C++ and TEST_PROPERTY_C(name, value)
for C, allowing test bodies to attach key-value metadata that appears in
JUnit XML output as <property> elements inside <testcase> blocks.

Properties flow through the existing UtestShell -> TestResult ->
TestOutput call chain, with JUnitTestOutput storing them on per-test-case
result nodes and emitting them when writing XML. The <properties> block
is only emitted when at least one property is present. Property names and
values are XML-encoded.
@thetic
Test TEST_PROPERTY and TEST_PROPERTY_C macros end-to-end
d35e57b
Adds a PropertySpyOutput that captures printTestProperty calls, and two
tests that drive the macros through ExecFunctionTestShell with a spy
result to verify the full routing chain from macro invocation to output.

Also adds the cpputest_test_property_c_caller helper in the C test file
to exercise TEST_PROPERTY_C from actual C code.
@thetic
Document TEST_PROPERTY in README
16035ba
@thetic
Add missing prototype for cpputest_test_property_c_caller
8527137
Fixes -Wmissing-prototypes error with clang-cl -Werror.
@coveralls

coveralls commented Apr 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

coverage: 99.285% (+0.004%) from 99.281%
when pulling 976c4b8 on thetic:feature/test-property
into 79c066e on cpputest:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thetic added 2 commits March 31, 2026 23:03
@thetic
Test TestOutput::printTestProperty and CompositeTestOutput delegation
85bb9a3
@thetic
Eliminate unnecessary macro indirection
976c4b8
We don't need a macro that just forwards to a function.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@thetic @coveralls
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.