bool TestExtProcess::test_exec() { Variant output, ret; String last_line = f_exec("echo hello; echo world;", ref(output), ref(ret)); VS(output, CREATE_VECTOR2("hello", "world")); VS(last_line, "world"); VS(ret, 0); string cur_cwd = Process::GetCurrentDirectory(); f_chdir("/tmp/"); VS(f_exec("/bin/pwd"), "/tmp"); f_chdir(String(cur_cwd)); return Count(true); }
bool TestExtProcess::test_exec() { Variant output, ret; String last_line = f_exec("echo hello; echo world;", ref(output), ref(ret)); VS(output, CREATE_VECTOR2("hello", "world")); VS(last_line, "world"); VS(ret, 0); return Count(true); }