1 #include "common/config.h"
2 #include "common/run_cmd.h"
4 #include "gtest/gtest.h"
9 TEST(RunCommand, StringSimple)
11 char temp_file_name[] = "run_cmd_temp_file_XXXXXX";
13 int fd = ::mkstemp(temp_file_name);
17 std::string ret = run_cmd("touch", temp_file_name, (char*)NULL);
20 ASSERT_EQ(access(temp_file_name, R_OK), 0);
22 ret = run_cmd("rm", "-f", temp_file_name, (char*)NULL);
25 ASSERT_NE(access(temp_file_name, R_OK), 0);