diff --git a/test/BUILD.gn b/test/BUILD.gn index 8e27bc4c26..58d3dab521 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -253,6 +253,7 @@ rtc_library("perf_test") { "../rtc_base:logging", "../rtc_base:rtc_numerics", "../rtc_base/synchronization:mutex", + "../test:fileutils", ] absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] if (rtc_enable_protobuf) { diff --git a/test/testsupport/perf_test.cc b/test/testsupport/perf_test.cc index 3a436749fb..b68eaa46a1 100644 --- a/test/testsupport/perf_test.cc +++ b/test/testsupport/perf_test.cc @@ -19,6 +19,7 @@ #include "rtc_base/checks.h" #include "rtc_base/synchronization/mutex.h" +#include "test/testsupport/file_utils.h" #include "test/testsupport/perf_test_histogram_writer.h" namespace webrtc { @@ -221,6 +222,7 @@ void PrintPlottableResults(const std::vector& desired_graphs) { bool WritePerfResults(const std::string& output_path) { std::string results = GetPerfResults(); + CreateDir(DirName(output_path)); FILE* output = fopen(output_path.c_str(), "wb"); if (output == NULL) { printf("Failed to write to %s.\n", output_path.c_str()); diff --git a/tools_webrtc/flags_compatibility.py b/tools_webrtc/flags_compatibility.py old mode 100644 new mode 100755 index 63e3f1fb19..d3570a5254 --- a/tools_webrtc/flags_compatibility.py +++ b/tools_webrtc/flags_compatibility.py @@ -10,7 +10,6 @@ import argparse import logging -import os import subprocess import sys @@ -22,11 +21,6 @@ def main(): test_command = _ForcePythonInterpreter(unrecognized_args) if args.isolated_script_test_perf_output: - # TODO(bugs.webrtc.org/11895): Move this code somewhere else because - # flags_compatibility.py shouldn't create output directories. - output_dirname = os.path.dirname(args.isolated_script_test_perf_output) - if not os.path.exists(output_dirname): - os.makedirs(output_dirname) test_command += ['--isolated_script_test_perf_output=' + args.isolated_script_test_perf_output] logging.info('Running %r', test_command)