Skip to content

Commit 41cce2b

Browse files
committed
WIP JUnitXML output support
1 parent d36dd0b commit 41cce2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1072
-844
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BasedOnStyle: Google
1+
BasedOnStyle: Chromium
22
ColumnLimit: 120

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/rhysd/actionlint
3+
rev: v1.7.7
4+
hooks:
5+
- id: actionlint
6+
- repo: https://github.com/pre-commit/mirrors-clang-format
7+
rev: v20.1.0
8+
hooks:
9+
- id: clang-format
10+
types_or: [c, c++]
11+
files: 'include/.*(?<!\.hpp)$'

examples/sample/example_spec.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <cstring>
44
#include <list>
55
#include "cppspec.hpp"
6-
#include "formatters/verbose.hpp"
76

87
describe bool_spec("Some Tests", $ {
98
context("true is", _ {
@@ -219,5 +218,5 @@ int main(int argc, char **argv){
219218
.add_spec(let_spec)
220219
.add_spec(list_spec)
221220
.add_spec(expectation_spec)
222-
.exec() ? EXIT_SUCCESS : EXIT_FAILURE;
221+
.exec().is_success() ? EXIT_SUCCESS : EXIT_FAILURE;
223222
}

examples/sample/jasmine_intro.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2016 Katherine Whitlock
22

33
#include "cppspec.hpp"
4-
#include "formatters/verbose.hpp"
54

65
describe a_suite("A suite", $ {
76
it("contains a spec with an expectation", _ {
@@ -266,5 +265,5 @@ int main(int argc, char** argv) {
266265
.add_spec(a_spec_before_each)
267266
.add_spec(a_spec_nesting)
268267
.add_spec(to_include_matcher)
269-
.exec() ? EXIT_SUCCESS : EXIT_FAILURE;
268+
.exec().is_success() ? EXIT_SUCCESS : EXIT_FAILURE;
270269
}

include/argparse.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <argparse/argparse.hpp>
44
#include <string_view>
55

6+
#include "formatters/junit_xml.hpp"
67
#include "formatters/progress.hpp"
78
#include "formatters/tap.hpp"
89
#include "formatters/verbose.hpp"
@@ -30,7 +31,7 @@ inline Runner parse(int argc, char** const argv) {
3031

3132
program.add_argument("-f", "--format")
3233
.default_value(std::string{"p"})
33-
.choices("progress", "p", "tap", "t", "detail", "d")
34+
.choices("progress", "p", "tap", "t", "detail", "d", "junit", "j")
3435
.required()
3536
.help("set the output format");
3637

@@ -53,6 +54,8 @@ inline Runner parse(int argc, char** const argv) {
5354
opts.formatter = std::make_unique<Formatters::Progress>();
5455
} else if (format_string == "t" || format_string == "tap") {
5556
opts.formatter = std::make_unique<Formatters::TAP>();
57+
} else if (format_string == "j" || format_string == "junit") {
58+
opts.formatter = std::make_unique<Formatters::JUnitXML>();
5659
} else {
5760
std::cerr << "Unrecognized format type" << std::endl;
5861
std::exit(-1);

include/child.hpp

Lines changed: 0 additions & 159 deletions
This file was deleted.

0 commit comments

Comments
 (0)