github.com/GoogleCloudPlatform/golang-samples/testing/sampletests (go): The sampletests command adds the region tags tested by each test to the XML properties of that test case. It reads JUnit XML from stdin and writes JUnit XML to stdout.  For example, if TestFoo tests the regions foo_hello_world and foo_hello_gopher, the TestFoo element will have the following property:  sampletests only looks at direct function calls or references by tests. So, if you have a map from string -> function reference in the global scope and test functions only reference the string, sampletests will not work.  There are some duplicate region tags, but they aren't tracked anywhere else, so it's OK if they are "applied" to more than one test.  sampletests only looks in the current module, which matches the behavior of `go test`. So, if you run `go test ./...` and sampletests in the same directory they should both find the same set of packages.  The test coverage over all regions is printed to stderr at the end. The coverage is based on the entire module, not just the tests that happen to be in the given XML input. The XML may not be for for all tests in the module.  Warnings are printed to stderr for invalid region tags (e.g. mis-matched START and END tags).  The -enable_xml flag can be used to disable XML processing and only print warnings and coverage.  To get the number of unique region tags in the repo manually, run:
Keywords: appengine|go|golang|google-appengine|google-cloud|sample|samples