Flutter Engine
txt_run_all_unittests.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 <cassert>
18 
19 #include "flutter/fml/backtrace.h"
20 #include "flutter/fml/command_line.h"
21 #include "flutter/fml/icu_util.h"
22 #include "flutter/fml/logging.h"
23 #include "flutter/testing/testing.h"
24 #include "third_party/skia/include/core/SkGraphics.h"
25 #include "txt_test_utils.h"
26 
27 int main(int argc, char** argv) {
32  if (txt::GetFontDir().length() <= 0) {
33  FML_LOG(ERROR) << "Font directory not set via txt::SetFontDir.";
34  return EXIT_FAILURE;
35  }
37 #if defined(OS_FUCHSIA)
38  fml::icu::InitializeICU("/pkg/data/icudtl.dat");
39 #else
40  fml::icu::InitializeICU("icudtl.dat");
41 #endif
42  SkGraphics::Init();
43  testing::InitGoogleTest(&argc, argv);
44  return RUN_ALL_TESTS();
45 }
void InstallCrashHandler()
Definition: backtrace.cc:133
int main(int argc, char **argv)
#define FML_DCHECK(condition)
Definition: logging.h:86
CommandLine CommandLineFromArgcArgv(int argc, const char *const *argv)
Definition: command_line.h:222
void InitializeICU(const std::string &icu_data_path)
Definition: icu_util.cc:103
#define FML_LOG(severity)
Definition: logging.h:65
void SetFontDir(const std::string &dir)
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
size_t length
const std::string & GetFontDir()
void SetCommandLine(fml::CommandLine cmd)