From 135aad0048df9151337bea3bd39b4c8d138f3d1d Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Fri, 21 Sep 2018 13:56:26 +0200 Subject: [PATCH] Make webrtc_perf_tests output an empty result output.json to satisfy a stricter check introduced in https://chromium.googlesource.com/chromium/tools/build/+/503174a3e1e439c6ab0b18d263980fd18a3d2855 The file is supposed to contain actual gtest results, so having an empty one is a workaround, but this just returns things to the way they were. TBR: phoglund@webrtc.org No-Try: True Bug: webrtc:9767, chromium:885194 Change-Id: I693cc2df9dfcafd7b728deb9efd445d8fe2c4edf Reviewed-on: https://webrtc-review.googlesource.com/101301 Commit-Queue: Oleh Prypin Reviewed-by: Yves Gerey Cr-Commit-Position: refs/heads/master@{#24783} --- test/test_main.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/test_main.cc b/test/test_main.cc index 46a7de6b22..8091b3fb74 100644 --- a/test/test_main.cc +++ b/test/test_main.cc @@ -8,6 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include + #include "rtc_base/flags.h" #include "rtc_base/logging.h" #include "rtc_base/thread.h" @@ -38,9 +40,10 @@ DEFINE_bool( #else -DEFINE_string(isolated_script_test_output, - "", - "Intentionally ignored flag intended for Chromium."); +DEFINE_string( + isolated_script_test_output, + "", + "Path to output an empty JSON file which Chromium infra requires."); DEFINE_string( isolated_script_test_perf_output, @@ -112,6 +115,13 @@ int main(int argc, char* argv[]) { webrtc::test::WritePerfResults(chartjson_result_file); } + std::string result_filename = FLAG_isolated_script_test_output; + if (!result_filename.empty()) { + std::ofstream result_file(result_filename); + result_file << "{\"version\": 3}"; + result_file.close(); + } + return exit_code; #endif