run_timeout

This commit is contained in:
Zengtudor 2024-08-18 13:05:25 +08:00
parent e74c692fe6
commit b9d2040a2c
2 changed files with 7 additions and 7 deletions

View File

@ -143,10 +143,10 @@ int main(int argc, char* argv[]) {
std::filesystem::create_directory(buildDir);
}
LOG("getting run time out")
int runtimeout = 0;
if(jsonValue["runtimeout"]!=Json::nullValue){
runtimeout = jsonValue["runtimeout"].asInt();
printValue(runtimeout)
int run_timeout = 0;
if(jsonValue["run_timeout"]!=Json::nullValue){
run_timeout = jsonValue["run_timeout"].asInt();
printValue(run_timeout)
}
LOG("compiling")
string compileCommands;
@ -219,8 +219,8 @@ int main(int argc, char* argv[]) {
}
vector<ProgramRet> results(jsonTests.size()+1);
for(auto &i:futures){
if(runtimeout>0){
if(i.wait_for(std::chrono::milliseconds(runtimeout))==std::future_status::ready){
if(run_timeout>0){
if(i.wait_for(std::chrono::milliseconds(run_timeout))==std::future_status::ready){
auto ret = i.get();
results[ret.id]=ret;
}

View File

@ -15,5 +15,5 @@
"ans":"2.ans"
}
],
"runtimeout":100
"run_timeout":100
}