aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2015-09-09 09:16:03 +0200
committerGravatar Ulf Adams <ulfjack@google.com>2015-09-09 09:16:45 +0200
commit2fc8bf242c81d3305dd18753902442a30b0c1d91 (patch)
tree347d69de34a0c2cfbfc02702cbc8d730ba10db23 /third_party
parent7b4bd6eda8a2818ae4fcda0ee9953fa194e8bba9 (diff)
Also check the XML_TEST_OUTPUT env variable and generate xml output if set.
Change-Id: Ie657f0dba2cd92805fc0ef832f2300b87b5905c8
Diffstat (limited to 'third_party')
-rw-r--r--third_party/gtest/gtest_main.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/gtest/gtest_main.cc b/third_party/gtest/gtest_main.cc
index f302822552..47136fc52b 100644
--- a/third_party/gtest/gtest_main.cc
+++ b/third_party/gtest/gtest_main.cc
@@ -33,6 +33,12 @@
GTEST_API_ int main(int argc, char **argv) {
printf("Running main() from gtest_main.cc\n");
+ // For Bazel, also check the XML_OUTPUT_FILE env variable, and enable the
+ // xml output accordingly; see: http://bazel.io/docs/test-encyclopedia.html
+ const char* xml_output_file = getenv("XML_OUTPUT_FILE");
+ if (xml_output_file != NULL) {
+ testing::FLAGS_gtest_output = (std::string) "xml:" + xml_output_file;
+ }
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}