Skip to content

Commit

Permalink
regenerate code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss committed Aug 2, 2024
1 parent 017d451 commit 773087f
Show file tree
Hide file tree
Showing 47 changed files with 1,600 additions and 35 deletions.
2 changes: 2 additions & 0 deletions cpp/include/messages/cucumber/messages/all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <cucumber/messages/table_cell.hpp>
#include <cucumber/messages/table_row.hpp>
#include <cucumber/messages/tag.hpp>
#include <cucumber/messages/global_hook_finished.hpp>
#include <cucumber/messages/global_hook_started.hpp>
#include <cucumber/messages/hook.hpp>
#include <cucumber/messages/location.hpp>
#include <cucumber/messages/meta.hpp>
Expand Down
1 change: 1 addition & 0 deletions cpp/include/messages/cucumber/messages/attachment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct attachment
std::optional<std::string> test_case_started_id;
std::optional<std::string> test_step_id;
std::optional<std::string> url;
std::optional<std::string> test_run_started_id;

std::string to_string() const;

Expand Down
4 changes: 4 additions & 0 deletions cpp/include/messages/cucumber/messages/envelope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <cucumber/messages/test_run_started.hpp>
#include <cucumber/messages/test_step_finished.hpp>
#include <cucumber/messages/test_step_started.hpp>
#include <cucumber/messages/global_hook_started.hpp>
#include <cucumber/messages/global_hook_finished.hpp>
#include <cucumber/messages/undefined_parameter_type.hpp>

namespace cucumber::messages {
Expand Down Expand Up @@ -59,6 +61,8 @@ struct envelope
std::optional<cucumber::messages::test_run_started> test_run_started;
std::optional<cucumber::messages::test_step_finished> test_step_finished;
std::optional<cucumber::messages::test_step_started> test_step_started;
std::optional<cucumber::messages::global_hook_started> global_hook_started;
std::optional<cucumber::messages::global_hook_finished> global_hook_finished;
std::optional<cucumber::messages::undefined_parameter_type> undefined_parameter_type;

std::string to_string() const;
Expand Down
40 changes: 40 additions & 0 deletions cpp/include/messages/cucumber/messages/global_hook_finished.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once

#include <vector>
#include <string>
#include <optional>

#include <nlohmann/json.hpp>

#include <cucumber/messages/test_step_result.hpp>
#include <cucumber/messages/timestamp.hpp>

namespace cucumber::messages {

using json = nlohmann::json;

//
// Represents the GlobalHookFinished message in Cucumber's message protocol
// @see <a href=https://github.com/cucumber/messages>Github - Cucumber - Messages</a>
//
// Generated code

struct global_hook_finished
{
std::string test_run_started_id;
std::string hook_id;
cucumber::messages::test_step_result result;
cucumber::messages::timestamp timestamp;

std::string to_string() const;

void to_json(json& j) const;
std::string to_json() const;
};

std::ostream&
operator<<(std::ostream& os, const global_hook_finished& msg);

void to_json(json& j, const global_hook_finished& m);

}
38 changes: 38 additions & 0 deletions cpp/include/messages/cucumber/messages/global_hook_started.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once

#include <vector>
#include <string>
#include <optional>

#include <nlohmann/json.hpp>

#include <cucumber/messages/timestamp.hpp>

namespace cucumber::messages {

using json = nlohmann::json;

//
// Represents the GlobalHookStarted message in Cucumber's message protocol
// @see <a href=https://github.com/cucumber/messages>Github - Cucumber - Messages</a>
//
// Generated code

struct global_hook_started
{
std::string test_run_started_id;
std::string hook_id;
cucumber::messages::timestamp timestamp;

std::string to_string() const;

void to_json(json& j) const;
std::string to_json() const;
};

std::ostream&
operator<<(std::ostream& os, const global_hook_started& msg);

void to_json(json& j, const global_hook_started& m);

}
1 change: 1 addition & 0 deletions cpp/include/messages/cucumber/messages/test_case.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct test_case
std::string id;
std::string pickle_id;
std::vector<cucumber::messages::test_step> test_steps;
std::optional<std::string> test_run_started_id;

std::string to_string() const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct test_run_finished
bool success;
cucumber::messages::timestamp timestamp;
std::optional<cucumber::messages::exception> exception;
std::optional<std::string> test_run_started_id;

std::string to_string() const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ using json = nlohmann::json;
struct test_run_started
{
cucumber::messages::timestamp timestamp;
std::optional<std::string> id;

std::string to_string() const;

Expand Down
2 changes: 2 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/attachment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ attachment::to_string() const
cucumber::messages::to_string(oss, ", test_case_started_id=", test_case_started_id);
cucumber::messages::to_string(oss, ", test_step_id=", test_step_id);
cucumber::messages::to_string(oss, ", url=", url);
cucumber::messages::to_string(oss, ", test_run_started_id=", test_run_started_id);

return oss.str();
}
Expand All @@ -33,6 +34,7 @@ attachment::to_json(json& j) const
cucumber::messages::to_json(j, camelize("test_case_started_id"), test_case_started_id);
cucumber::messages::to_json(j, camelize("test_step_id"), test_step_id);
cucumber::messages::to_json(j, camelize("url"), url);
cucumber::messages::to_json(j, camelize("test_run_started_id"), test_run_started_id);
}

std::string
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/envelope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ envelope::to_string() const
cucumber::messages::to_string(oss, ", test_run_started=", test_run_started);
cucumber::messages::to_string(oss, ", test_step_finished=", test_step_finished);
cucumber::messages::to_string(oss, ", test_step_started=", test_step_started);
cucumber::messages::to_string(oss, ", global_hook_started=", global_hook_started);
cucumber::messages::to_string(oss, ", global_hook_finished=", global_hook_finished);
cucumber::messages::to_string(oss, ", undefined_parameter_type=", undefined_parameter_type);

return oss.str();
Expand All @@ -50,6 +52,8 @@ envelope::to_json(json& j) const
cucumber::messages::to_json(j, camelize("test_run_started"), test_run_started);
cucumber::messages::to_json(j, camelize("test_step_finished"), test_step_finished);
cucumber::messages::to_json(j, camelize("test_step_started"), test_step_started);
cucumber::messages::to_json(j, camelize("global_hook_started"), global_hook_started);
cucumber::messages::to_json(j, camelize("global_hook_finished"), global_hook_finished);
cucumber::messages::to_json(j, camelize("undefined_parameter_type"), undefined_parameter_type);
}

Expand Down
54 changes: 54 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/global_hook_finished.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <sstream>

#include <cucumber/messages/utils.hpp>
#include <cucumber/messages/global_hook_finished.hpp>

namespace cucumber::messages {

std::string
global_hook_finished::to_string() const
{
std::ostringstream oss;

cucumber::messages::to_string(oss, "test_run_started_id=", test_run_started_id);
cucumber::messages::to_string(oss, ", hook_id=", hook_id);
cucumber::messages::to_string(oss, ", result=", result);
cucumber::messages::to_string(oss, ", timestamp=", timestamp);

return oss.str();
}

void
global_hook_finished::to_json(json& j) const
{
cucumber::messages::to_json(j, camelize("test_run_started_id"), test_run_started_id);
cucumber::messages::to_json(j, camelize("hook_id"), hook_id);
cucumber::messages::to_json(j, camelize("result"), result);
cucumber::messages::to_json(j, camelize("timestamp"), timestamp);
}

std::string
global_hook_finished::to_json() const
{
std::ostringstream oss;
json j;

to_json(j);

oss << j;

return oss.str();
}

std::ostream&
operator<<(std::ostream& os, const global_hook_finished& msg)
{
os << msg.to_string();

return os;
}

void to_json(json& j, const global_hook_finished& m)
{ m.to_json(j); }

}
52 changes: 52 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/global_hook_started.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <sstream>

#include <cucumber/messages/utils.hpp>
#include <cucumber/messages/global_hook_started.hpp>

namespace cucumber::messages {

std::string
global_hook_started::to_string() const
{
std::ostringstream oss;

cucumber::messages::to_string(oss, "test_run_started_id=", test_run_started_id);
cucumber::messages::to_string(oss, ", hook_id=", hook_id);
cucumber::messages::to_string(oss, ", timestamp=", timestamp);

return oss.str();
}

void
global_hook_started::to_json(json& j) const
{
cucumber::messages::to_json(j, camelize("test_run_started_id"), test_run_started_id);
cucumber::messages::to_json(j, camelize("hook_id"), hook_id);
cucumber::messages::to_json(j, camelize("timestamp"), timestamp);
}

std::string
global_hook_started::to_json() const
{
std::ostringstream oss;
json j;

to_json(j);

oss << j;

return oss.str();
}

std::ostream&
operator<<(std::ostream& os, const global_hook_started& msg)
{
os << msg.to_string();

return os;
}

void to_json(json& j, const global_hook_started& m)
{ m.to_json(j); }

}
2 changes: 2 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/test_case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test_case::to_string() const
cucumber::messages::to_string(oss, "id=", id);
cucumber::messages::to_string(oss, ", pickle_id=", pickle_id);
cucumber::messages::to_string(oss, ", test_steps=", test_steps);
cucumber::messages::to_string(oss, ", test_run_started_id=", test_run_started_id);

return oss.str();
}
Expand All @@ -23,6 +24,7 @@ test_case::to_json(json& j) const
cucumber::messages::to_json(j, camelize("id"), id);
cucumber::messages::to_json(j, camelize("pickle_id"), pickle_id);
cucumber::messages::to_json(j, camelize("test_steps"), test_steps);
cucumber::messages::to_json(j, camelize("test_run_started_id"), test_run_started_id);
}

std::string
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/test_run_finished.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test_run_finished::to_string() const
cucumber::messages::to_string(oss, ", success=", success);
cucumber::messages::to_string(oss, ", timestamp=", timestamp);
cucumber::messages::to_string(oss, ", exception=", exception);
cucumber::messages::to_string(oss, ", test_run_started_id=", test_run_started_id);

return oss.str();
}
Expand All @@ -25,6 +26,7 @@ test_run_finished::to_json(json& j) const
cucumber::messages::to_json(j, camelize("success"), success);
cucumber::messages::to_json(j, camelize("timestamp"), timestamp);
cucumber::messages::to_json(j, camelize("exception"), exception);
cucumber::messages::to_json(j, camelize("test_run_started_id"), test_run_started_id);
}

std::string
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/lib/messages/cucumber/messages/test_run_started.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ test_run_started::to_string() const
std::ostringstream oss;

cucumber::messages::to_string(oss, "timestamp=", timestamp);
cucumber::messages::to_string(oss, ", id=", id);

return oss.str();
}
Expand All @@ -19,6 +20,7 @@ void
test_run_started::to_json(json& j) const
{
cucumber::messages::to_json(j, camelize("timestamp"), timestamp);
cucumber::messages::to_json(j, camelize("id"), id);
}

std::string
Expand Down
11 changes: 9 additions & 2 deletions dotnet/Cucumber.Messages/generated/Attachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public sealed class Attachment
* separately from reports.
*/
public string Url { get; private set; }
public string TestRunStartedId { get; private set; }


public Attachment(
Expand All @@ -83,7 +84,8 @@ public Attachment(
Source source,
string testCaseStartedId,
string testStepId,
string url
string url,
string testRunStartedId
)
{
RequireNonNull<string>(body, "Body", "Attachment.Body cannot be null");
Expand All @@ -97,6 +99,7 @@ string url
this.TestCaseStartedId = testCaseStartedId;
this.TestStepId = testStepId;
this.Url = url;
this.TestRunStartedId = testRunStartedId;
}

public override bool Equals(Object o)
Expand All @@ -112,7 +115,8 @@ public override bool Equals(Object o)
Object.Equals(Source, that.Source) &&
Object.Equals(TestCaseStartedId, that.TestCaseStartedId) &&
Object.Equals(TestStepId, that.TestStepId) &&
Object.Equals(Url, that.Url);
Object.Equals(Url, that.Url) &&
Object.Equals(TestRunStartedId, that.TestRunStartedId);
}

public override int GetHashCode()
Expand All @@ -133,6 +137,8 @@ public override int GetHashCode()
hash = hash * 31 + TestStepId.GetHashCode();
if (Url != null)
hash = hash * 31 + Url.GetHashCode();
if (TestRunStartedId != null)
hash = hash * 31 + TestRunStartedId.GetHashCode();
return hash;
}

Expand All @@ -147,6 +153,7 @@ public override string ToString()
", testCaseStartedId=" + TestCaseStartedId +
", testStepId=" + TestStepId +
", url=" + Url +
", testRunStartedId=" + TestRunStartedId +
'}';
}

Expand Down
Loading

0 comments on commit 773087f

Please sign in to comment.