• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

thetic / mutiny / 24496111858

16 Apr 2026 06:42AM UTC coverage: 98.499% (-0.1%) from 98.642%
24496111858

Pull #58

github

web-flow
Merge 4b35d227b into 405a5edbc
Pull Request #58: Junity

68 of 73 new or added lines in 2 files covered. (93.15%)

3 existing lines in 1 file now uncovered.

5119 of 5197 relevant lines covered (98.5%)

4069.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.38
/src/test/JUnitOutputPlugin.cpp
1
#include "mutiny/test/JUnitOutputPlugin.hpp"
2

3
#include "mutiny/test/JUnitOutput.hpp"
4

5
#include "mutiny/String.hpp"
6

7
namespace mu {
8
namespace tiny {
9
namespace test {
10

11
namespace {
12

13
String basename_from_path(const char* path)
1✔
14
{
15
  if (!path || !*path)
1✔
NEW
16
    return "";
×
17
  const char* base = path;
1✔
18
  for (const char* p = path; *p; ++p) {
10✔
19
    if (*p == '/' || *p == '\\')
9✔
NEW
20
      base = p + 1;
×
21
  }
22
  return base;
1✔
23
}
24

25
} // namespace
26

27
JUnitOutputPlugin::JUnitOutputPlugin()
69✔
28
  : Plugin("JUnitOutputPlugin")
69✔
29
{
30
}
69✔
31

32
bool JUnitOutputPlugin::parse_arguments(
2✔
33
    int /*argc*/,
34
    const char* const* argv,
35
    int index
36
)
37
{
38
  String arg = argv[index];
2✔
39
  if (!string_starts_with(arg, "-pjunit"))
2✔
40
    return false;
1✔
41
  if (arg.size() > 7) {
1✔
NEW
42
    if (arg[7] != '=')
×
NEW
43
      return false;
×
NEW
44
    package_name_ = arg.substr(8);
×
45
  } else {
46
    package_name_ = basename_from_path(argv[0]);
1✔
47
  }
48
  active_ = true;
1✔
49
  return true;
1✔
50
}
2✔
51

52
String JUnitOutputPlugin::get_help() const
5✔
53
{
54
  return "  -pjunit[=<name>]  - output JUnit XML as <name>.xml\n"
55
         "                      (defaults to the executable basename)\n";
5✔
56
}
57

58
Output* JUnitOutputPlugin::create_output()
66✔
59
{
60
  if (!active_)
66✔
61
    return nullptr;
65✔
62
  auto* output = new JUnitOutput;
1✔
63
  if (!package_name_.empty())
1✔
64
    output->set_package_name(package_name_);
1✔
65
  return output;
1✔
66
}
67

68
} // namespace test
69
} // namespace tiny
70
} // namespace mu
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc