Make Template to pass the default goals set for code coverage (#3198)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
This commit is contained in:
parent
f937eae89c
commit
5de42570e2
@ -10,6 +10,7 @@ namespace Azure { namespace Template {
|
||||
class TemplateClient final {
|
||||
public:
|
||||
std::string ClientVersion() const;
|
||||
int GetValue(int key) const;
|
||||
};
|
||||
|
||||
}} // namespace Azure::Template
|
||||
|
||||
@ -11,3 +11,13 @@ using namespace Azure::Template;
|
||||
using namespace Azure::Template::_detail;
|
||||
|
||||
std::string TemplateClient::ClientVersion() const { return PackageVersion::ToString(); }
|
||||
|
||||
int TemplateClient::GetValue(int key) const
|
||||
{
|
||||
if (key < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return key + 1;
|
||||
}
|
||||
|
||||
@ -13,3 +13,12 @@ TEST(Template, Basic)
|
||||
|
||||
EXPECT_FALSE(templateClient.ClientVersion().empty());
|
||||
}
|
||||
|
||||
TEST(Template, GetValue)
|
||||
{
|
||||
TemplateClient templateClient;
|
||||
|
||||
EXPECT_EQ(templateClient.GetValue(-1), 0);
|
||||
EXPECT_EQ(templateClient.GetValue(0), 1);
|
||||
EXPECT_EQ(templateClient.GetValue(1), 2);
|
||||
}
|
||||
|
||||
@ -27,13 +27,6 @@ stages:
|
||||
parameters:
|
||||
ServiceDirectory: template
|
||||
CtestRegex: azure-template
|
||||
# The azure-template project has lower branch coverage than the default.
|
||||
# This overrides the branch coverage floor until the issue can be
|
||||
# addressed. Once it is addressed this line should be removed so that
|
||||
# projects generated from this ci.yml file don't set a coverage target
|
||||
# that is lower than the baseline defined in archetype-sdk-client.yml
|
||||
# Issue: https://github.com/Azure/azure-sdk-for-cpp/issues/3022
|
||||
BranchCoverageTarget: 33
|
||||
Artifacts:
|
||||
- Name: azure-template
|
||||
Path: azure-template
|
||||
|
||||
Loading…
Reference in New Issue
Block a user