Exemplo n.º 1
0
bool TestExtProcess::test_passthru() {
  g_context->obStart();
  Variant ret;
  f_passthru("echo hello; echo world;", ref(ret));
  String output = g_context->obGetContents();
  g_context->obEnd();

  VS(output, "hello\nworld\n");
  VS(ret, 0);
  return Count(true);
}
Exemplo n.º 2
0
bool TestExtProcess::test_passthru() {
  g_context->obStart();
  Variant ret;
  f_passthru("echo hello; echo world;", ref(ret));
  String output = g_context->obCopyContents();
  g_context->obEnd();

  VS(output, "hello\nworld\n");
  VS(ret, 0);


  string cur_cwd = Process::GetCurrentDirectory();
  f_chdir("/tmp/");
  g_context->obStart();
  f_passthru("/bin/pwd");
  output = g_context->obCopyContents();
  g_context->obEnd();
  VS(output, "/tmp\n");
  f_chdir(String(cur_cwd));

  return Count(true);
}