Write pb perf output files on iOS.

Bug: chromium:1029452
Change-Id: I8cc44630109292b9ad1ab7d03b34c2c5e1b953fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170980
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30827}
This commit is contained in:
Patrik Höglund
2020-03-19 08:51:35 +01:00
committed by Commit Bot
parent e55f0c3384
commit 3428827c40
2 changed files with 16 additions and 16 deletions

View File

@ -77,10 +77,8 @@ static absl::optional<std::vector<std::string>> g_metrics_to_plot;
int exitStatus = g_test_suite();
if (g_write_perf_output) {
// Stores data into a json file under the app's document directory.
// TODO(https://crbug.com/1029452): Change ext to .pb when histograms are
// the default.
NSString* fileName = @"perf_result.json";
// Stores data into a proto file under the app's document directory.
NSString *fileName = @"perftest-output.pb";
NSArray<NSString*>* outputDirectories = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
if ([outputDirectories count] != 0) {
@ -119,12 +117,12 @@ namespace test {
void InitTestSuite(int (*test_suite)(void),
int argc,
char *argv[],
bool save_chartjson_result,
bool write_perf_output,
absl::optional<std::vector<std::string>> metrics_to_plot) {
g_test_suite = test_suite;
g_argc = argc;
g_argv = argv;
g_write_perf_output = save_chartjson_result;
g_write_perf_output = write_perf_output;
g_metrics_to_plot = std::move(metrics_to_plot);
}

View File

@ -47,14 +47,16 @@ ABSL_FLAG(std::string,
ApplePersistenceIgnoreState,
"",
"Intentionally ignored flag intended for iOS simulator.");
// This is the cousin of isolated_script_test_perf_output, but we can't dictate
// where to write on iOS so the semantics of this flag are a bit different.
ABSL_FLAG(
bool,
save_chartjson_result,
write_perf_output_on_ios,
false,
"Store the perf results in Documents/perf_result.json in the format "
"described by "
"https://github.com/catapult-project/catapult/blob/master/dashboard/docs/"
"data-format.md.");
"Store the perf results in Documents/perftest_result.pb in the format "
"described by histogram.proto in "
"https://chromium.googlesource.com/catapult/.");
#else
@ -67,10 +69,10 @@ ABSL_FLAG(
std::string,
isolated_script_test_perf_output,
"",
"Path where the perf results should be stored in the JSON format described "
"by "
"https://github.com/catapult-project/catapult/blob/master/dashboard/docs/"
"data-format.md.");
"Path where the perf results should be stored in proto format described "
"described by histogram.proto in "
"https://chromium.googlesource.com/catapult/.");
#endif
constexpr char kPlotAllMetrics[] = "all";
@ -171,7 +173,7 @@ class TestMainImpl : public TestMain {
#if defined(WEBRTC_IOS)
rtc::test::InitTestSuite(RUN_ALL_TESTS, argc, argv,
absl::GetFlag(FLAGS_save_chartjson_result),
absl::GetFlag(FLAGS_write_perf_output_on_ios),
metrics_to_plot);
rtc::test::RunTestsFromIOSApp();
int exit_code = 0;