提交 8be8f079 编写于 作者: F FondMemoryVVV

Modify the format

Signed-off-by: NFondMemoryVVV <mashuai53@huawei.com>
上级 f1486d77
......@@ -20,11 +20,11 @@
#include "gettestfiles.cpp"
#include "runtest.h"
namespace OHOS{
using namespace std;
static vector<std::string> filenames;
vector<std::string> GetFileNames(std::string path)
std::vector<std::string> runtest::GetFileNames(std::string path)
{
vector<string> tempName;
GetTestNames(path, tempName);
......@@ -37,4 +37,5 @@ vector<std::string> GetFileNames(std::string path)
filenames.push_back(tempName[i]);
}
return filenames;
}
\ No newline at end of file
}
} //namespace OHOS
\ No newline at end of file
......@@ -18,8 +18,13 @@
#include <iostream>
#include <string>
#include <vector>
namespace OHOS {
int t_setrlim(int r, long lim);
std::vector<std::string> GetFileNames(std::string path);
class runtest
{
public:
static int t_setrlim(int r, long lim);
static std::vector<std::string> GetFileNames(std::string path);
};
} //namespace OHOS
#endif // TOOLCHAIN_LIBC_TEST_INCLUDE_RUNTEST_H_
......@@ -18,8 +18,8 @@
#include <sys/resource.h>
#include "runtest.h"
int t_setrlim(int r, long lim)
namespace OHOS{
int runtest::t_setrlim(int r, long lim)
{
struct rlimit rl;
......@@ -40,4 +40,5 @@ int t_setrlim(int r, long lim)
return -1;
}
return 0;
}
\ No newline at end of file
}
} //namespace OHOS
\ No newline at end of file
......@@ -37,7 +37,7 @@ namespace OHOS {
class toolchaintest : public ::testing::TestWithParam<string> {};
static string filepath = "/data/local/tmp/libc-test/src";
static vector<string> temp = GetFileNames(filepath);
static vector<std::string> temp = runtest::GetFileNames(filepath);
volatile int t_status = 0;
static void handler(int s)
......@@ -50,7 +50,7 @@ static int start(char *wrap, const char *argvs)
pid = fork();
if (pid == 0) {
t_setrlim(RLIMIT_STACK, space_size);
runtest::t_setrlim(RLIMIT_STACK, space_size);
int exe = execl(argvs, "strptime", nullptr);
printf("exe:%d %s exec failed: %s\n", exe, argvs, strerror(errno));
exit(1);
......@@ -64,11 +64,13 @@ static int runTests(const char *argvs)
int timeoutsec = 5, timeout = 0;
int status, pid;
sigset_t set;
void (*retfunc)(int);
sigemptyset(&set);
sigaddset(&set, SIGCHLD);
sigprocmask(SIG_BLOCK, &set, nullptr);
if (signal(SIGCHLD, handler) == SIG_ERR) {
retfunc = signal(SIGCHLD, handler);
if (retfunc == SIG_ERR) {
printf("signal triggering failed:%s\n", strerror(errno));
}
pid = start(wrap, argvs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册