| Flutter Impeller |

Functions
main.cc File Reference
`#include <wordexp.h>`
`#include "flutter/fml/backtrace.h"`
`#include "flutter/fml/build_config.h"`
`#include "flutter/fml/command_line.h"`
`#include "flutter/fml/logging.h"`
`#include "flutter/impeller/golden_tests/golden_digest.h"`
`#include "flutter/impeller/golden_tests/working_directory.h"`
`#include "gtest/gtest.h"`

Go to the source code of this file.

## Functions
int | main (int argc, char **argv)

## Function Documentation

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 27 of file main.cc.

27 {
28 fml::InstallCrashHandler();
29 testing::InitGoogleTest(&argc, argv);
30 fml::CommandLine cmd = fml::CommandLineFromPlatformOrArgcArgv(argc, argv);
31
32 std::optional<std::string> working_dir;
33 for (const auto& option : cmd.options()) {
34 if (option.name == "working_dir") {
35 wordexp_t wordexp_result;
36 int code = wordexp(option.value.c_str(), &wordexp_result, 0);
37 FML_CHECK(code == 0);
38 FML_CHECK(wordexp_result.we_wordc != 0);
39 working_dir = wordexp_result.we_wordv[0];
40 wordfree(&wordexp_result);
41 }
42 }
43 if (!working_dir) {
44 std::cout << "required argument \"working_dir\" is missing." << std::endl
45 << std::endl;
46 print_usage();
47 return 1;
48 }
49
50 impeller::testing::WorkingDirectory::Instance()->SetPath(working_dir.value());
51 std::cout << "working directory: "
52 << impeller::testing::WorkingDirectory::Instance()->GetPath()
53 << std::endl;
54
55 int return_code = RUN_ALL_TESTS();
56 if (0 == return_code) {
57 impeller::testing::GoldenDigest::Instance()->Write(
58 impeller::testing::WorkingDirectory::Instance());
59 }
60 return return_code;
61 }

References impeller::testing::WorkingDirectory::GetPath(), impeller::testing::WorkingDirectory::Instance(), impeller::testing::GoldenDigest::Instance(), impeller::testing::WorkingDirectory::SetPath(), and impeller::testing::GoldenDigest::Write().

impeller::testing::WorkingDirectory::SetPath
void SetPath(const std::string &path)
Definition: working_directory.cc:28
impeller::testing::WorkingDirectory::GetPath
const std::string & GetPath() const
Definition: working_directory.h:25
impeller::testing::GoldenDigest::Write
bool Write(WorkingDirectory *working_directory)
Definition: golden_digest.cc:42
impeller::testing::GoldenDigest::Instance
static GoldenDigest * Instance()
Definition: golden_digest.cc:18
impeller::testing::WorkingDirectory::Instance
static WorkingDirectory * Instance()
Definition: working_directory.cc:16