29 Commits

Author SHA1 Message Date
Joël Stemmer
5e492f8212 gtr: rename Package.AddProperty to Package.SetProperty
Properties are stored in a map, so SetProperty better reflects its
behaviour.
2022-03-22 22:05:23 +00:00
Joël Stemmer
01e84dfcf5 Print arguments when non-flag arguments were set 2022-03-22 22:05:23 +00:00
Joël Stemmer
884279de84 Deprecate the -go-version flag
The `-go-version` flag is used to set the `go.version` property in the
generated XML file. In v2 we no longer want a flag dedicated to a
specific property. Instead, the -prop flag has been introduced to set
arbitrary properties in the generated report.

If the `-go-version` flag is set, we'll still add a `go.version`
property to the report but also print a warning. This flag will be
removed completely in the future.
2022-03-22 22:05:23 +00:00
Joël Stemmer
c50f4331dc Add -prop flag to add properties to a generated report
The value of the -prop flag should be specified as key=value. The -prop
flag only supports specifying one property at a time. To add multiple
properties, add a `-prop key=value` argument for each property.
2022-03-22 22:05:23 +00:00
Joël Stemmer
a77bfe0f1c gtr,junit: move creation of JUnit testsuites from gtr to junit
Package gtr shouldn't need to know about the existence of different
output formats like junit.
2022-03-22 22:05:23 +00:00
Joël Stemmer
43c784a63b Set non-zero exit code for build/run errors when using -set-exit-code 2022-03-20 22:35:50 +00:00
Joël Stemmer
e6ab84c924 Add -iocopy flag to copy input to stdout
In order to use -iocopy to copy the input to stdout, you must provide a
file with the -out flag to write the XML report to.
2022-03-20 22:35:50 +00:00
Joël Stemmer
aecba5f156 Add -in and -out flags to read input from file and write output to file 2022-03-20 22:35:50 +00:00
Joël Stemmer
cbb95f301a Create exitf function to print message and exit with non-zero exit code 2022-03-20 22:35:50 +00:00
Joël Stemmer
2ece8eae1a gtr: Set hostname and timestamp fields when creating JUnit Testsuite
Fixes #117
2022-03-20 22:35:50 +00:00
Joël Stemmer
77ad1709cf gtr: Add default package name to report 2022-03-20 22:35:50 +00:00
Joël Stemmer
72cd8b3697 Update go-junit-report to use new parser 2022-03-20 22:35:47 +00:00
Joël Stemmer
5b78a29c68 Create a v2 module and bump version to v2.0.0-dev
The old parser and formatter packages will be replaced with new packages
that are not backwards compatible. For this reason we must increment the
major version of this module.
2022-03-06 23:49:00 +00:00
Joël Stemmer
16c7efad77 Bump version to v1.0.0 2022-02-24 22:01:24 +00:00
Joël Stemmer
b2b06e7a1e Add -version flag to print current version 2022-02-19 14:35:37 +00:00
Joël Stemmer
27e2e8f782 Print usage on flag error 2019-10-04 00:05:01 +01:00
Joël Stemmer
f79a156ed8 Define flags directly and remove init function 2019-10-04 00:03:12 +01:00
Mark Rushakoff
63c2422f96 Reject positional CLI arguments
My team spent a bit of time debugging a mistake where we forgot to
redirect output to a file. The command looked valid and exited 0. This
change causes the program to fail if provided with any positional
arguments.
2018-12-13 11:41:34 -08:00
John Millikin
03cda22671
Move junit-formatter.go to its own package for use as a library.
This lets JUnit xml generation be integrated into larger tools
instead of having to run the `go-junit-report` binary as a subprocess.
2018-03-16 16:09:48 -07:00
Joël Stemmer
b66d44cd3a Run gofmt on go-junit-report.go 2017-03-28 18:12:00 +01:00
Nick Miyake
22792ea55c Add "go-version" flag
Makes it so that the value of the "go.version" property in
the output XML can be customized by the caller using the
"go-version" flag. If the flag is unspecified, falls back to
the previous behavior of using runtime.Version() as the value.

Fixes #48
2017-03-26 15:43:14 -07:00
Craig Peterson
a30d4886ed moving parser into subpackage 2015-05-14 17:07:05 -06:00
itamarb
a34e6b2365 adding 'set-exit-code' flag
Defaults to false. When true, sets the exit-code to 1 if any tests
failed. This is useful for automation.
2015-05-08 13:56:18 +03:00
Joël Stemmer
e705d170a3 Fix golint suggestions 2015-02-06 13:57:44 +01:00
Tachikoma
27383b3a74 compiled test's output have no result line, fill "package name" with flag -package-name , and fill "time" with sum of individual tests' time. 2014-12-22 21:53:08 +08:00
Tachikoma
8cd3db55e5 add flag -no-xml-header 2014-12-22 20:59:04 +08:00
Joel Stemmer
c9c0e1877c Write JUnit report xml
Add tests
2012-03-09 19:52:48 +01:00
Joel Stemmer
4b851d63d2 Parse successful tests 2012-03-09 16:41:35 +01:00
Joel Stemmer
8fcd615a51 Initial commit 2012-03-09 15:38:06 +01:00