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

Function TEST

tensorflow/core/platform/fake_python_env_test.cc:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35namespace tensorflow {
36
37TEST(FakePythonEnvTest, GetExecutablePath) {
38 // See if argc is greater than 1 and first arg is kPythonFile
39 // If not, rerun the executable with proper args.
40 if (myargc <= 1 || strstr(myargv[1], kMagicBazelDirSubstring) == nullptr) {
41 const char* filename = myargv[0];
42 char* new_argv[] = {
43 myargv[0],
44 kPythonFile,
45 nullptr,
46 };
47
48 execv(filename, new_argv);
49 }
50
51 Env* env = Env::Default();
52 // We depend on the file/executable name to include python and fool the
53 // library to think this is running under the python interpreter.
54 string path = env->GetExecutablePath();
55 EXPECT_TRUE(strstr(path.c_str(), kMagicBazelDirSubstring) != nullptr);
56}
57
58} // namespace tensorflow
59

Callers

nothing calls this directly

Calls 3

DefaultFunction · 0.85
GetExecutablePathMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected