Skip to content

Commit fa9941a

Browse files
committed
wip
1 parent 848b828 commit fa9941a

File tree

12 files changed

+146
-157
lines changed

12 files changed

+146
-157
lines changed

include/vcpkg/base/message-data.inc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,6 @@ DECLARE_MESSAGE(CiBaselineDisallowedCascade,
472472
(msg::spec, msg::path),
473473
"",
474474
"REGRESSION: {spec} cascaded, but it is required to pass. ({path}).")
475-
DECLARE_MESSAGE(CiBaselineIndependentRegression,
476-
(msg::spec, msg::build_result),
477-
"",
478-
"REGRESSION: Independent {spec} failed with {build_result}.")
479475
DECLARE_MESSAGE(CiBaselineRegression,
480476
(msg::spec, msg::build_result, msg::path),
481477
"",

include/vcpkg/ci-baseline.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,5 @@ namespace vcpkg
6262
BuildResult result,
6363
const CiBaselineData& cidata,
6464
const std::string* cifile,
65-
bool allow_unexpected_passing,
66-
bool is_independent);
65+
bool allow_unexpected_passing);
6766
}

include/vcpkg/commands.install.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ namespace vcpkg
5050
Optional<ExtendedBuildResult> build_result;
5151
vcpkg::ElapsedTime timing;
5252
std::chrono::system_clock::time_point start_time;
53-
Optional<const InstallPlanAction&> get_install_plan_action() const
54-
{
55-
return m_install_action ? Optional<const InstallPlanAction&>(*m_install_action) : nullopt;
56-
}
53+
const InstallPlanAction* get_maybe_install_plan_action() const { return m_install_action; }
5754

5855
private:
5956
const InstallPlanAction* m_install_action;

include/vcpkg/xunitwriter.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313

1414
namespace vcpkg
1515
{
16+
struct CiBuiltResult
17+
{
18+
std::string package_abi;
19+
InternalFeatureSet feature_list;
20+
std::chrono::system_clock::time_point start_time;
21+
ElapsedTime timing;
22+
};
23+
24+
struct CiResult
25+
{
26+
BuildResult code; // FIXME describe why excluded
27+
Optional<CiBuiltResult> build;
28+
};
29+
1630
struct XunitTest;
1731

1832
// https://xunit.net/docs/format-xml-v2
@@ -22,12 +36,7 @@ namespace vcpkg
2236
// Out of line con/destructor avoids exposing XunitTest
2337
XunitWriter();
2438
~XunitWriter();
25-
void add_test_results(const PackageSpec& spec,
26-
BuildResult build_result,
27-
const ElapsedTime& elapsed_time,
28-
const std::chrono::system_clock::time_point& start_time,
29-
const std::string& abi_tag,
30-
const std::vector<std::string>& features);
39+
void add_test_results(const PackageSpec& spec, const CiResult& result);
3140

3241
std::string build_xml(Triplet controlling_triplet) const;
3342

locales/messages.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@
297297
"CiBaselineAllowUnexpectedPassingRequiresBaseline": "--allow-unexpected-passing can only be used if a baseline is provided via --ci-baseline.",
298298
"CiBaselineDisallowedCascade": "REGRESSION: {spec} cascaded, but it is required to pass. ({path}).",
299299
"_CiBaselineDisallowedCascade.comment": "An example of {spec} is zlib:x64-windows. An example of {path} is /foo/bar.",
300-
"CiBaselineIndependentRegression": "REGRESSION: Independent {spec} failed with {build_result}.",
301-
"_CiBaselineIndependentRegression.comment": "An example of {spec} is zlib:x64-windows. An example of {build_result} is One of the BuildResultXxx messages (such as BuildResultSucceeded/SUCCEEDED).",
302300
"CiBaselineRegression": "REGRESSION: {spec} failed with {build_result}. If expected, add {spec}=fail to {path}.",
303301
"_CiBaselineRegression.comment": "An example of {spec} is zlib:x64-windows. An example of {build_result} is One of the BuildResultXxx messages (such as BuildResultSucceeded/SUCCEEDED). An example of {path} is /foo/bar.",
304302
"CiBaselineRegressionHeader": "REGRESSIONS:",

src/vcpkg-test/ci-baseline.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ TEST_CASE ("format_ci_result 1", "[ci-baseline]")
333333
SECTION ("SUCCEEDED")
334334
{
335335
const auto test = [&](PackageSpec s, bool allow_unexpected_passing) {
336-
return format_ci_result(s, BuildResult::Succeeded, cidata, &cifile, allow_unexpected_passing, false);
336+
return format_ci_result(s, BuildResult::Succeeded, cidata, &cifile, allow_unexpected_passing);
337337
};
338338
CHECK(test({"pass", Test::X64_UWP}, true) == "");
339339
CHECK(test({"pass", Test::X64_UWP}, false) == "");
@@ -347,7 +347,7 @@ TEST_CASE ("format_ci_result 1", "[ci-baseline]")
347347
SECTION ("BUILD_FAILED")
348348
{
349349
const auto test = [&](PackageSpec s) {
350-
return format_ci_result(s, BuildResult::BuildFailed, cidata, &cifile, false, false);
350+
return format_ci_result(s, BuildResult::BuildFailed, cidata, &cifile, false);
351351
};
352352
CHECK(test({"pass", Test::X64_UWP}) == fmt::format(failmsg, "pass:x64-uwp"));
353353
CHECK(test({"fail", Test::X64_UWP}) == "");
@@ -357,7 +357,7 @@ TEST_CASE ("format_ci_result 1", "[ci-baseline]")
357357
SECTION ("CASCADED_DUE_TO_MISSING_DEPENDENCIES")
358358
{
359359
const auto test = [&](PackageSpec s) {
360-
return format_ci_result(s, BuildResult::CascadedDueToMissingDependencies, cidata, &cifile, false, false);
360+
return format_ci_result(s, BuildResult::CascadedDueToMissingDependencies, cidata, &cifile, false);
361361
};
362362
CHECK(test({"pass", Test::X64_UWP}) == fmt::format(cascademsg, "pass:x64-uwp"));
363363
CHECK(test({"fail", Test::X64_UWP}) == "");

src/vcpkg-test/xunitwriter.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ using namespace vcpkg;
77
TEST_CASE ("Simple XunitWriter", "[xunitwriter]")
88
{
99
XunitWriter x;
10-
time_t time = {0};
1110
Triplet t = Triplet::from_canonical_name("triplet");
1211
PackageSpec spec("name", t);
13-
x.add_test_results(spec, BuildResult::BuildFailed, {}, std::chrono::system_clock::from_time_t(time), "", {});
12+
x.add_test_results(spec, CiResult{BuildResult::BuildFailed, nullopt});
1413
CHECK(x.build_xml(t) == R"(<?xml version="1.0" encoding="utf-8"?><assemblies>
1514
<assembly name="name" run-date="1970-01-01" run-time="00:00:00" time="0">
1615
<collection name="triplet" time="0">
17-
<test name="name:triplet" method="name[]:triplet" time="0" result="Fail">
16+
<test name="name:triplet" method="name:triplet" time="0" result="Fail">
1817
<traits>
1918
<trait name="owner" value="triplet"/>
2019
</traits>
@@ -29,40 +28,50 @@ TEST_CASE ("Simple XunitWriter", "[xunitwriter]")
2928
TEST_CASE ("XunitWriter Two", "[xunitwriter]")
3029
{
3130
XunitWriter x;
32-
time_t time = {0};
31+
time_t january_first = {0};
32+
time_t january_second = {86400};
33+
auto january_first_st = std::chrono::system_clock::from_time_t(january_first);
34+
auto january_second_st = std::chrono::system_clock::from_time_t(january_second);
3335
Triplet t = Triplet::from_canonical_name("triplet");
3436
Triplet t2 = Triplet::from_canonical_name("triplet2");
3537
Triplet t3 = Triplet::from_canonical_name("triplet3");
3638
PackageSpec spec("name", t);
3739
PackageSpec spec2("name", t2);
3840
PackageSpec spec3("other", t2);
39-
x.add_test_results(spec, BuildResult::Succeeded, {}, std::chrono::system_clock::from_time_t(time), "abihash", {});
4041
x.add_test_results(
41-
spec2, BuildResult::PostBuildChecksFailed, {}, std::chrono::system_clock::from_time_t(time), "", {});
42+
spec,
43+
CiResult{BuildResult::Succeeded,
44+
CiBuiltResult{"abihash", InternalFeatureSet{"a", "b", "core"}, january_first_st, ElapsedTime{}}});
45+
x.add_test_results(spec2, CiResult{BuildResult::PostBuildChecksFailed, nullopt});
4246
x.add_test_results(
43-
spec3, BuildResult::Succeeded, {}, std::chrono::system_clock::from_time_t(time), "", {"core", "feature"});
47+
spec3,
48+
CiResult{
49+
BuildResult::Succeeded,
50+
CiBuiltResult{"otherabihash", InternalFeatureSet{"core", "feature"}, january_second_st, ElapsedTime{}}});
4451
CHECK(x.build_xml(t3) == R"(<?xml version="1.0" encoding="utf-8"?><assemblies>
4552
<assembly name="name" run-date="1970-01-01" run-time="00:00:00" time="0">
4653
<collection name="triplet3" time="0">
47-
<test name="name:triplet" method="name[]:triplet" time="0" result="Pass">
54+
<test name="name:triplet" method="name[a,b,core]:triplet" time="0" result="Pass">
4855
<traits>
4956
<trait name="abi_tag" value="abihash"/>
57+
<trait name="features" value="a,b,core"/>
5058
<trait name="owner" value="triplet"/>
5159
</traits>
5260
</test>
53-
<test name="name:triplet2" method="name[]:triplet2" time="0" result="Fail">
61+
<test name="name:triplet2" method="name:triplet2" time="0" result="Fail">
5462
<traits>
5563
<trait name="owner" value="triplet2"/>
5664
</traits>
5765
<failure><message><![CDATA[POST_BUILD_CHECKS_FAILED]]></message></failure>
5866
</test>
5967
</collection>
6068
</assembly>
61-
<assembly name="other" run-date="1970-01-01" run-time="00:00:00" time="0">
69+
<assembly name="other" run-date="1970-01-02" run-time="00:00:00" time="0">
6270
<collection name="triplet3" time="0">
6371
<test name="other:triplet2" method="other[core,feature]:triplet2" time="0" result="Pass">
6472
<traits>
65-
<trait name="features" value="core, feature"/>
73+
<trait name="abi_tag" value="otherabihash"/>
74+
<trait name="features" value="core,feature"/>
6675
<trait name="owner" value="triplet2"/>
6776
</traits>
6877
</test>

src/vcpkg/ci-baseline.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ namespace vcpkg
190190
BuildResult result,
191191
const CiBaselineData& cidata,
192192
const std::string* cifile,
193-
bool allow_unexpected_passing,
194-
bool is_independent)
193+
bool allow_unexpected_passing)
195194
{
196195
switch (result)
197196
{
@@ -200,13 +199,6 @@ namespace vcpkg
200199
case BuildResult::FileConflicts:
201200
if (!cidata.expected_failures.contains(spec))
202201
{
203-
if (is_independent)
204-
{
205-
return msg::format(msgCiBaselineIndependentRegression,
206-
msg::spec = spec,
207-
msg::build_result = to_string_locale_invariant(result));
208-
}
209-
210202
if (cifile)
211203
{
212204
return msg::format(msgCiBaselineRegression,

0 commit comments

Comments
 (0)