no message

This commit is contained in:
2024-09-22 23:10:27 +03:00
parent 12c4eaf33d
commit a420ddbc9d
12 changed files with 142 additions and 143 deletions

View File

@@ -32,7 +32,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
//--
protected LinkedHashMap<String, Test> testsByDescriptions = null;
protected Vector<String> testsNames_lower = null; //все тесты что участвуют здесь
protected Vector<LanguageName> groupsLanguages = null;
protected File sapfor = null;
//--
protected Vector<SapforTask> new_tasks = null;
@@ -41,93 +40,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
return "/icons/Start.png";
}
//--
boolean checkTerminalCode(SapforConfiguration sapforConfiguration, PassCode_2021 code, int count, Vector<PassCode_2021> codes) {
if (count > 2) {
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": " +
code.getDescription() +
" возможно только один раз.");
return false;
}
//--
if ((count == 1) && codes.size() > 1) {
if (!codes.lastElement().equals(code)) {
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": " +
code.getDescription() +
" может быть только завершающей командой!");
return false;
}
}
return true;
}
boolean checkStartingCode(SapforConfiguration sapforConfiguration, PassCode_2021 code, int count, Vector<PassCode_2021> codes) {
if (count > 2) {
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": " +
code.getDescription() +
" возможно только один раз.");
return false;
}
//--
if ((count == 1) && codes.size() > 1) {
if (!codes.firstElement().equals(code)) {
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": " +
code.getDescription() +
" может быть только первой командой!");
return false;
}
}
return true;
}
//--
//--
public boolean checkConfigurationCommands(SapforConfiguration sapforConfiguration) {
//1. получить список всех команд.
Vector<PassCode_2021> codes = new Vector<>();
//-- счетчик завершающих команд.
LinkedHashMap<PassCode_2021, Index> terminalCodesCount = new LinkedHashMap<>();
for (PassCode_2021 code : Constants.terminalSapforTestingCodes)
terminalCodesCount.put(code, new Index());
//--
LinkedHashMap<PassCode_2021, Index> startingCodesCount = new LinkedHashMap<>();
for (PassCode_2021 code : Constants.startingSapforTestingCodes)
startingCodesCount.put(code, new Index());
//--
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
if (command.sapforconfiguration_id == sapforConfiguration.id) {
codes.add(command.passCode);
//---
for (PassCode_2021 t_code : Constants.terminalSapforTestingCodes) {
if (command.passCode.equals(t_code))
terminalCodesCount.get(t_code).Inc();
}
//---
for (PassCode_2021 s_code : Constants.startingSapforTestingCodes) {
if (command.passCode.equals(s_code))
startingCodesCount.get(s_code).Inc();
}
}
}
//--
if (codes.size() == 0) {
Log.Writeln_("Пустая конфигурация:" + sapforConfiguration.id);
return false;
}
for (PassCode_2021 t_code : Constants.terminalSapforTestingCodes) {
if (!checkTerminalCode(sapforConfiguration, t_code,
terminalCodesCount.get(t_code).getValue(), codes
))
return false;
}
//-
for (PassCode_2021 s_code : Constants.startingSapforTestingCodes) {
if (!checkStartingCode(sapforConfiguration, s_code,
startingCodesCount.get(s_code).getValue(), codes
))
return false;
}
//--
return true;
}
//--
protected boolean checkTestName(Test test) {
String name = test.description.toLowerCase();
if (testsNames_lower.contains(name)) {
@@ -162,7 +74,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
//--
testsNames_lower = new Vector<>();
testsByDescriptions = new LinkedHashMap<>();
groupsLanguages = new Vector<>();
//--
new_tasks= new Vector<>();
//--
@@ -185,7 +96,7 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
int max_kernels = 1;
for (SapforConfiguration configuration : configurations) {
max_kernels = Math.max(configuration.kernels, max_kernels);
if (!checkConfigurationCommands(configuration))
if (!(configuration.validate(Log)))
return false;
//-
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(configuration);
@@ -194,19 +105,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
tests = cache.getTests();
//--
for (Group group : groups) {
//-
if (!groupsLanguages.contains(group.language))
groupsLanguages.add(group.language);
//-
if (groupsLanguages.get(0) != LanguageName.fortran) {
Log.Writeln_("Поддерживается пакетный режим только для языка Fortran!");
return false;
}
if (groupsLanguages.size() > 1) {
Log.Writeln_("Запуск тестов на разных языках в рамках одного пакета запрещен!");
return false;
}
//---
Vector<Test> groupTests = new Vector<>();
for (Test test : tests) {
if (test.group_id == group.id)

View File

@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.Utils;
import Common.Constants;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import java.io.File;
@@ -7,7 +8,14 @@ public class TestPass extends Pass_2021<File> {
@Override
protected void body() throws Exception {
//определить дату изменения проекта.
target = new File("E:\\Tests\\bugreport_1712090719\\SP");
Utils.getNewestFileDate(target);
// target = new File("E:\\Tests\\bugreport_1712090719\\SP");
// Utils.getNewestFileDate(target);
System.out.println("start");
for (PassCode_2021 passCode_2021: Constants.startSapforCodes)
System.out.println(passCode_2021);
//---
System.out.println("terminal");
for (PassCode_2021 passCode_2021: Constants.terminalSapforCodes)
System.out.println(passCode_2021);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.Constants;
public enum PassCode_2021 {
Undefined,
//-
@@ -1025,5 +1026,12 @@ public enum PassCode_2021 {
}
return p + " " + name;
}
//-- для тестирования.
public boolean isSapforStart(){
return Constants.startSapforCodes.contains(this);
}
public boolean isSapforTerminal(){
return Constants.terminalSapforCodes.contains(this);
}
}