Пример #1
0
void
Program::ExecuteNoWait(const Path& path,
                       const char** args,
                       const char** envp,
                       const Path** redirects,
                       unsigned memoryLimit,
                       std::string* ErrMsg) {
    Program prg;
    prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg);
}
Пример #2
0
int main() {
  srand(time(NULL));
  int t = 0;
  int nonZero = 0;
  while (1) {
    Program p;
    p.GenerateFuzz();
    //p.Print();
    //printf("----\n");
    int result = p.Execute(100);
    if (result) nonZero++;
    t++;
    printf("%d Execution result on input 100: %10d, non-zero so far: %d (%3.3f%%)\n", t, result, nonZero, float(100*nonZero)/t);
    //printf("\n");
  }
  return 0;
}
Пример #3
0
int
Program::ExecuteAndWait(const Path& path,
                        const char** args,
                        const char** envp,
                        const Path** redirects,
                        unsigned secondsToWait,
                        unsigned memoryLimit,
                        std::string* ErrMsg,
                        bool *ExecutionFailed) {
    Program prg;
    if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) {
        if (ExecutionFailed) *ExecutionFailed = false;
        return prg.Wait(path, secondsToWait, ErrMsg);
    }
    if (ExecutionFailed) *ExecutionFailed = true;
    return -1;
}
Пример #4
-1
int
Program::ExecuteAndWait(const Path& path,
                        const char** args,
                        const char** envp,
                        const Path** redirects,
                        unsigned secondsToWait,
                        unsigned memoryLimit,
                        std::string* ErrMsg) {
  Program prg;
  if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg))
    return prg.Wait(path, secondsToWait, ErrMsg);
  else
    return -1;
}