@@ -60,9 +60,10 @@ namespace vcpkg::Commands::CI
60
60
void add_test_results (const std::string& spec,
61
61
const Build::BuildResult& build_result,
62
62
const Chrono::ElapsedTime& elapsed_time,
63
- const std::string& abi_tag)
63
+ const std::string& abi_tag,
64
+ const std::vector<std::string>& features)
64
65
{
65
- m_collections.back ().tests .push_back ({spec, build_result, elapsed_time, abi_tag});
66
+ m_collections.back ().tests .push_back ({spec, build_result, elapsed_time, abi_tag, features });
66
67
}
67
68
68
69
// Starting a new test collection
@@ -98,6 +99,7 @@ namespace vcpkg::Commands::CI
98
99
vcpkg::Build::BuildResult result;
99
100
vcpkg::Chrono::ElapsedTime time;
100
101
std::string abi_tag;
102
+ std::vector<std::string> features;
101
103
};
102
104
103
105
struct XunitCollection
@@ -166,9 +168,29 @@ namespace vcpkg::Commands::CI
166
168
}
167
169
168
170
std::string traits_block;
169
- if (test.abi_tag != " " ) // only adding if there is a known abi tag
171
+ if (test.abi_tag != " " )
170
172
{
171
- traits_block = Strings::format (R"( <traits><trait name="abi_tag" value="%s" /></traits>)" , test.abi_tag );
173
+ traits_block += Strings::format (R"( <trait name="abi_tag" value="%s" />)" , test.abi_tag );
174
+ }
175
+
176
+ if (!test.features .empty ())
177
+ {
178
+ std::string feature_list;
179
+ for (const auto & feature : test.features )
180
+ {
181
+ if (!feature_list.empty ())
182
+ {
183
+ feature_list += " , " ;
184
+ }
185
+ feature_list += feature;
186
+ }
187
+
188
+ traits_block += Strings::format (R"( <trait name="features" value="%s" />)" , feature_list);
189
+ }
190
+
191
+ if (!traits_block.empty ())
192
+ {
193
+ traits_block = " <traits>" + traits_block + " </traits>" ;
172
194
}
173
195
174
196
m_xml += Strings::format (R"( <test name="%s" method="%s" time="%lld" result="%s">%s%s</test>)"
@@ -458,20 +480,24 @@ namespace vcpkg::Commands::CI
458
480
// Adding results for ports that were built or pulled from an archive
459
481
for (auto && result : summary.results )
460
482
{
483
+ auto & port_features = split_specs->features [result.spec ];
461
484
split_specs->known .erase (result.spec );
462
485
xunitTestResults.add_test_results (result.spec .to_string (),
463
486
result.build_result .code ,
464
487
result.timing ,
465
- split_specs->abi_tag_map .at (result.spec ));
488
+ split_specs->abi_tag_map .at (result.spec ),
489
+ port_features);
466
490
}
467
491
468
492
// Adding results for ports that were not built because they have known states
469
493
for (auto && port : split_specs->known )
470
494
{
495
+ auto & port_features = split_specs->features [port.first ];
471
496
xunitTestResults.add_test_results (port.first .to_string (),
472
497
port.second ,
473
498
Chrono::ElapsedTime{},
474
- split_specs->abi_tag_map .at (port.first ));
499
+ split_specs->abi_tag_map .at (port.first ),
500
+ port_features);
475
501
}
476
502
477
503
all_known_results.emplace_back (std::move (split_specs->known ));
0 commit comments