MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ExecuteCommand

Function ExecuteCommand

tools/reduce/reduce.cpp:35–43  ·  view source on GitHub ↗

Execute a command using the shell. Returns true if and only if the command's exit status was 0.

Source from the content-addressed store, hash-verified

33// Execute a command using the shell.
34// Returns true if and only if the command's exit status was 0.
35bool ExecuteCommand(const std::string& command) {
36 errno = 0;
37 int status = std::system(command.c_str());
38 assert(errno == 0 && "failed to execute command");
39 // The result returned by 'system' is implementation-defined, but is
40 // usually the case that the returned value is 0 when the command's exit
41 // code was 0. We are assuming that here, and that's all we depend on.
42 return status == 0;
43}
44
45// Status and actions to perform after parsing command-line arguments.
46enum ReduceActions { REDUCE_CONTINUE, REDUCE_STOP };

Callers 1

mainFunction · 0.70

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected