MCPcopy Create free account
hub / github.com/Kitware/CMake / testJobServer

Function testJobServer

Tests/CMakeLib/testUVJobServerClient.cxx:140–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138};
139
140bool testJobServer()
141{
142#ifdef _WIN32
143 // FIXME: Windows job server client not yet implemented.
144#else
145 // Create a job server pipe.
146 int jobServerPipe[2];
147 if (cmGetPipes(jobServerPipe) < 0) {
148 std::cerr << "Failed to create job server pipe\n";
149 return false;
150 }
151
152 // Write N-1 tokens to the pipe.
153 std::vector<char> jobServerInit(kTOTAL_TOKENS - 1, '.');
154 if (write(jobServerPipe[1], jobServerInit.data(), jobServerInit.size()) !=
155 kTOTAL_TOKENS - 1) {
156 std::cerr << "Failed to initialize job server pipe\n";
157 return false;
158 }
159
160 // Establish the job server client context.
161 // Add a bogus server spec to verify we use the last spec.
162 cmSystemTools::PutEnv(cmStrCat("MAKEFLAGS=--flags-before"
163 " --jobserver-auth=bogus"
164 " --flags-between"
165 " --jobserver-fds=",
166 jobServerPipe[0], ',', jobServerPipe[1],
167 " --flags-after"));
168#endif
169
170 JobRunner jobRunner;
171 return jobRunner.Run();
172}
173}
174
175int testUVJobServerClient(int, char** const)

Callers 1

testUVJobServerClientFunction · 0.85

Calls 6

cmGetPipesFunction · 0.85
writeFunction · 0.85
cmStrCatFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…