MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / main

Function main

tensorflow/compiler/xla/parse_flags_from_env_test.cc:152–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150} // namespace xla
151
152int main(int argc, char* argv[]) {
153 // Save name of binary so that it may invoke itself.
154 xla::binary_name = argv[0];
155 bool recursing = false;
156 xla::int32 int_flag = 1;
157 const std::vector<tensorflow::Flag> flag_list = {
158 tensorflow::Flag("recursing", &recursing,
159 "Whether the binary is being invoked recursively."),
160 tensorflow::Flag("int_flag", &int_flag, "An integer flag to test with"),
161 };
162 xla::string usage = tensorflow::Flags::Usage(argv[0], flag_list);
163 bool parse_ok =
164 xla::ParseFlagsFromEnvAndDieIfUnknown("TF_XLA_FLAGS", flag_list);
165 if (!parse_ok) {
166 LOG(QFATAL) << "can't parse from environment\n" << usage;
167 }
168 parse_ok = tensorflow::Flags::Parse(&argc, argv, flag_list);
169 if (!parse_ok) {
170 LOG(QFATAL) << usage;
171 }
172 if (recursing) {
173 printf("%d\n", int_flag);
174 exit(0);
175 }
176 testing::InitGoogleTest(&argc, argv);
177 return RUN_ALL_TESTS();
178}

Callers

nothing calls this directly

Calls 5

UsageFunction · 0.85
ParseFunction · 0.85
exitFunction · 0.85
FlagClass · 0.50

Tested by

no test coverage detected