| Flutter Impeller |

Namespaces | 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/base/validation.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.

## Namespaces
| impeller

## Functions
| impeller::TEST (ValidationTest, IsFatal)
int | main (int argc, char **argv)

## Function Documentation

## ◆ main()

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

Definition at line 34 of file main.cc.

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

References impeller::testing::WorkingDirectory::GetPath(), impeller::ImpellerValidationErrorsSetFatal(), 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:23
impeller::ImpellerValidationErrorsSetFatal
void ImpellerValidationErrorsSetFatal(bool fatal)
Definition: validation.cc:17
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