Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
txt_run_all_benchmarks.cc
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "flutter/fml/command_line.h"
18#include "flutter/fml/icu_util.h"
19#include "flutter/fml/logging.h"
20#include "flutter/testing/testing.h"
21#include "flutter/third_party/txt/tests/txt_test_utils.h"
22#include "third_party/benchmark/include/benchmark/benchmark.h"
23
24// We will use a custom main to allow custom font directories for consistency.
25int main(int argc, char** argv) {
26 ::benchmark::Initialize(&argc, argv);
29 if (txt::GetFontDir().length() <= 0) {
30 FML_LOG(ERROR) << "Font directory not set via txt::SetFontDir.";
31 return EXIT_FAILURE;
32 }
34
35 std::string icudtl_path =
36 cmd.GetOptionValueWithDefault("icu-data-file-path", "icudtl.dat");
37 fml::icu::InitializeICU(icudtl_path);
38
39 ::benchmark::RunSpecifiedBenchmarks();
40}
#define FML_LOG(severity)
Definition logging.h:82
#define FML_DCHECK(condition)
Definition logging.h:103
size_t length
char ** argv
Definition library.h:9
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
void InitializeICU(const std::string &icu_data_path)
Definition icu_util.cc:102
CommandLine CommandLineFromPlatformOrArgcArgv(int argc, const char *const *argv)
Definition main.py:1
const std::string & GetFontDir()
void SetFontDir(const std::string &dir)
#define ERROR(message)