=head1 NAME =encoding UTF-8 go-junit-report - convert Go test output to JUnit XML =head1 SYNOPSIS B [B<-in> I] [B<-out> I] [I] B B<-version> B B<-help> =head1 DESCRIPTION B is a tool that converts B output to a JUnit compatible XML report, suitable for use with applications such as Jenkins or GitLab CI. By default, B reads B output generated by the standard library testing package from stdin and writes a JUnit XML report to stdout. Go build and runtime errors are also supported, but this requires that stderr is redirected to B as well. Typical use looks like this: go test -v 2E&1 ./... | go-junit-report -set-exit-code E report.xml Alternatively, B can consume JSON output of B. In this case, stderr still needs to be redirected for build errors to be detected. go test -json 2E&1 | go-junit-report -parser gojson E report.xml The B<-iocopy> flag copies stdin directly to stdout, which is useful to still be able to see the B output. go test -v 2E&1 ./... | go-junit-report -set-exit-code -iocopy -out report.xml =head1 OPTIONS =over =item B<-in> I Read the log from file. If not specified, stdin is used. =item B<-out> I Write XML report to file. If not specified, stdout is used. =item B<-iocopy> Copy input to stdout. Can only be used in conjunction with B<-out>. This is useful if you want to see what was sent to B. =item B<-no-xml-header> Do not print the XML header. =item B<-p> IB<=>I Add a I=I property to generated report. Repeat this flag to add multiple properties. =item B<-package-name> I Specify a default package name to use if test log does not contain a package name. =item B<-parser> I Set input parser type: B or B (default: B). =item B<-set-exit-code> Set exit code to 1 if tests failed. =item B<-subtest-mode> I Set subtest mode: B (subtest parents always pass), B (subtest parents are excluded from the report). =item B<-help> Print a summary of command-line options. =item B<-version> Print the B version. =item B<-debug.print-events> print events generated by the go test parser =item B<-go-version> I (deprecated, use B<-prop>) the value to use for the go.version property in the generated XML =back =head1 EXIT STATUS If B encounters an error during its operation, or doesn’t understand its command-line options, 2 is returned. If the input logs indicate the tests failed, and B<-set-exit-code> is specified, 1 is returned. Otherwise, 0 is returned. =head1 COPYRIGHT Copyright (C) 2025 Andrej Shadura.