конвертация стандартных тестов на стороне сервера. стало быстрее.
This commit is contained in:
@@ -11,6 +11,7 @@ import GlobalData.Tasks.TaskState;
|
||||
import GlobalData.User.User;
|
||||
import ProjectData.LanguageName;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Repository.Component.Sapfor.Sapfor;
|
||||
import Repository.EmailMessage;
|
||||
import Repository.RepositoryRefuseException;
|
||||
import Repository.RepositoryServer;
|
||||
@@ -389,7 +390,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
case RefreshDVMTests:
|
||||
Print("Синхронизировать репозиторий тестов ");
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = RefreshDVMTests((Account) request.object);
|
||||
response.object = RefreshDVMTests((Account) request.object, Integer.parseInt(request.arg));
|
||||
break;
|
||||
//--
|
||||
default:
|
||||
@@ -422,7 +423,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
//->>
|
||||
return new Pair<>(object, groupFiles);
|
||||
}
|
||||
public LinkedHashMap<Group, Vector<Test>> RefreshDVMTests(Account account) throws Exception {
|
||||
public LinkedHashMap<Group, Vector<Test>> RefreshDVMTests(Account account, int sapfor_id) throws Exception {
|
||||
ServerSapfor sapfor = null;
|
||||
if (!db.serverSapfors.containsKey(sapfor_id))
|
||||
throw new RepositoryRefuseException("Версия SAPFOR с ключом " + sapfor_id + " не найдена.");
|
||||
sapfor = db.serverSapfors.get(sapfor_id);
|
||||
DownloadRepository downloadRepository = new DownloadRepository();
|
||||
if (!downloadRepository.Do())
|
||||
throw new RepositoryRefuseException("Не удалось обновить репозиторий");
|
||||
@@ -496,6 +501,38 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
File archive = test.getArchive();
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
zip.Do(testProject.getAbsolutePath(), archive.getAbsolutePath());
|
||||
//---
|
||||
//Определение размерности
|
||||
switch (group.language) {
|
||||
case fortran:
|
||||
if (Sapfor.parse(Sapfor.getTempCopy(new File(sapfor.call_command)), testProject, "-noLogo")
|
||||
) {
|
||||
if (Sapfor.analysis(Sapfor.getTempCopy(new File(sapfor.call_command)), testProject,
|
||||
PassCode_2021.SPF_GetMaxMinBlockDistribution,
|
||||
"-noLogo"
|
||||
)) {
|
||||
for (String line : Sapfor.outputLines) {
|
||||
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
|
||||
if (line.startsWith(prefix)) {
|
||||
String s = line.substring(prefix.length());
|
||||
String[] data = s.split(" ");
|
||||
test.min_dim = Math.max(Integer.parseInt(data[0]), 0);
|
||||
test.max_dim = Math.max(Integer.parseInt(data[1]), 0);
|
||||
db.Update(test);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
throw new RepositoryRefuseException("Не удалось определить размерность.проекта " + Utils.Brackets(test.description));
|
||||
} else {
|
||||
throw new RepositoryRefuseException("Не удалось выполнить синтаксический анализ проекта " + Utils.Brackets(test.description));
|
||||
}
|
||||
break;
|
||||
case c:
|
||||
test.max_dim = Utils.getCTestMaxDim(testFile);
|
||||
db.Update(test);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user