no message
This commit is contained in:
23
.idea/workspace.xml
generated
23
.idea/workspace.xml
generated
@@ -7,24 +7,17 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneCurrentDVMConfiguration.java" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/Common/Utils/Vector_.java" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/CloneConfiguration.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Constants.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/UI.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Configuration/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Configuration/Configuration.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Configuration/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Configuration/Configuration.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingBar.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfiguration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfiguration.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfigurationCommand/SapforConfigurationCommandsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfigurationCommand/SapforConfigurationCommandsDBTable.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/UI/ConfigurationFields.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/UI/ConfigurationFields.form" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/UI/ConfigurationFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/UI/ConfigurationFields.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackage.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/UI/SapforConfigurationFields.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/UI/SapforConfigurationFields.form" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/UI/SapforConfigurationFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/UI/SapforConfigurationFields.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneDVMPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneDVMPackage.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneSapforPackage.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedDVMConfigurations.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedDVMConfigurations.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedSAPFORConfigurations.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedSAPFORConfigurations.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedSAPFORConfigurations.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedSAPFORConfigurations.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/TestPass.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package Common;
|
package Common;
|
||||||
import GlobalData.Machine.Machine;
|
import Common.Utils.Vector_;
|
||||||
import GlobalData.Machine.MachineType;
|
|
||||||
import GlobalData.User.User;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
|
|
||||||
|
import java.util.Vector;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int Nan = -1;
|
public static final int Nan = -1;
|
||||||
@@ -38,14 +37,23 @@ public class Constants {
|
|||||||
public static final String package_json = "package_json";
|
public static final String package_json = "package_json";
|
||||||
public static final String results_json = "results_json";
|
public static final String results_json = "results_json";
|
||||||
//--
|
//--
|
||||||
public static final PassCode_2021[] startingSapforTestingCodes = new PassCode_2021[]{
|
public static final PassCode_2021[] startingSapforTestingCodes_old = new PassCode_2021[]{
|
||||||
PassCode_2021.SPF_InsertIncludesPass
|
PassCode_2021.SPF_InsertIncludesPass
|
||||||
};
|
};
|
||||||
public static final PassCode_2021[] terminalSapforTestingCodes = new PassCode_2021[]{
|
public static final PassCode_2021[] terminalSapforTestingCodes_old = new PassCode_2021[]{
|
||||||
PassCode_2021.CreateParallelVariants,
|
PassCode_2021.CreateParallelVariants,
|
||||||
PassCode_2021.SPF_SharedMemoryParallelization,
|
PassCode_2021.SPF_SharedMemoryParallelization,
|
||||||
PassCode_2021.SPF_InsertDvmhRegions
|
PassCode_2021.SPF_InsertDvmhRegions
|
||||||
};
|
};
|
||||||
|
//--
|
||||||
|
public static final Vector<PassCode_2021> startSapforCodes =
|
||||||
|
new Vector_<>(PassCode_2021.SPF_InsertIncludesPass);
|
||||||
|
|
||||||
|
public static final Vector<PassCode_2021> terminalSapforCodes =
|
||||||
|
new Vector_<>( PassCode_2021.CreateParallelVariants,
|
||||||
|
PassCode_2021.SPF_SharedMemoryParallelization,
|
||||||
|
PassCode_2021.SPF_InsertDvmhRegions);
|
||||||
|
//---
|
||||||
public static final int parser_group = -1;
|
public static final int parser_group = -1;
|
||||||
public static final int compiler_group = -2;
|
public static final int compiler_group = -2;
|
||||||
// DBProjectFile
|
// DBProjectFile
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
|||||||
setPreferredSize(new Dimension(0, 30));
|
setPreferredSize(new Dimension(0, 30));
|
||||||
//---
|
//---
|
||||||
|
|
||||||
/*
|
|
||||||
add(new MenuBarButton() {
|
add(new MenuBarButton() {
|
||||||
{
|
{
|
||||||
setIcon("/icons/Apply.png");
|
setIcon("/icons/Apply.png");
|
||||||
@@ -66,7 +66,6 @@ public class MainMenuBar extends VisualiserMenuBar {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
ShowProject(false);
|
ShowProject(false);
|
||||||
}
|
}
|
||||||
public void ShowUpdatesIcon() {
|
public void ShowUpdatesIcon() {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package Common.UI;
|
package Common.UI;
|
||||||
|
import Common.Constants;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Database.DataSet;
|
import Common.Database.DataSet;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
@@ -16,6 +17,7 @@ import Common.UI.Trees.GraphTreeCellRenderer;
|
|||||||
import Common.UI.Trees.SelectionTreeCellRenderer;
|
import Common.UI.Trees.SelectionTreeCellRenderer;
|
||||||
import Common.UI.Windows.FormType;
|
import Common.UI.Windows.FormType;
|
||||||
import Common.UI.Windows.SearchReplaceForm;
|
import Common.UI.Windows.SearchReplaceForm;
|
||||||
|
import Common.Utils.Index;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Compiler.CompilersDBTable;
|
import GlobalData.Compiler.CompilersDBTable;
|
||||||
import GlobalData.Compiler.CompilersMenuBar;
|
import GlobalData.Compiler.CompilersMenuBar;
|
||||||
@@ -481,4 +483,5 @@ public class UI {
|
|||||||
public static void ShowProfilesWindow() {
|
public static void ShowProfilesWindow() {
|
||||||
getProfilesWindow().ShowDialog("");
|
getProfilesWindow().ShowDialog("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import GlobalData.Settings.SettingName;
|
|||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
import ProjectData.Files.DBProjectFile;
|
import ProjectData.Files.DBProjectFile;
|
||||||
import ProjectData.Project.db_project_info;
|
import ProjectData.Project.db_project_info;
|
||||||
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import Visual_DVM_2021.Passes.PassException;
|
import Visual_DVM_2021.Passes.PassException;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@@ -1190,7 +1191,7 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
//добавление строки в результат.
|
//добавление строки в результат.
|
||||||
if ((line.length() > 0) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean()
|
if ((line.length() > 0) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean()
|
||||||
// Global.db.settings.get(SettingName.SpacesOn).toBoolean()
|
// Global.db.settings.get(SettingName.SpacesOn).toBoolean()
|
||||||
) {
|
) {
|
||||||
lines.add(line.toString());
|
lines.add(line.toString());
|
||||||
visible_lines.add(v_line.toString());
|
visible_lines.add(v_line.toString());
|
||||||
@@ -1209,7 +1210,7 @@ public class Utils {
|
|||||||
//строка оборвалась на EOF
|
//строка оборвалась на EOF
|
||||||
//добавление строки в результат.
|
//добавление строки в результат.
|
||||||
if ((line.length() > 0) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean()
|
if ((line.length() > 0) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean()
|
||||||
// && Global.db.settings.get(SettingName.SpacesOn).toBoolean()
|
// && Global.db.settings.get(SettingName.SpacesOn).toBoolean()
|
||||||
) {
|
) {
|
||||||
lines.add(line.toString());
|
lines.add(line.toString());
|
||||||
visible_lines.add(v_line.toString());
|
visible_lines.add(v_line.toString());
|
||||||
@@ -1250,8 +1251,8 @@ public class Utils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
private static void get_newest_file_date_r(File dir, Vector<Long> dates){
|
private static void get_newest_file_date_r(File dir, Vector<Long> dates) {
|
||||||
Vector<File> files= new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
Vector<File> files = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File pathname) {
|
public boolean accept(File pathname) {
|
||||||
return pathname.isFile();
|
return pathname.isFile();
|
||||||
@@ -1267,18 +1268,18 @@ public class Utils {
|
|||||||
dates.add(files.firstElement().lastModified());
|
dates.add(files.firstElement().lastModified());
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
Vector<File> subdirs= new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
Vector<File> subdirs = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File pathname) {
|
public boolean accept(File pathname) {
|
||||||
return pathname.isDirectory();
|
return pathname.isDirectory();
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
if (!subdirs.isEmpty()){
|
if (!subdirs.isEmpty()) {
|
||||||
for (File subdir: subdirs)
|
for (File subdir : subdirs)
|
||||||
get_newest_file_date_r(subdir, dates);
|
get_newest_file_date_r(subdir, dates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static long getNewestFileDate(File dir){
|
public static long getNewestFileDate(File dir) {
|
||||||
Vector<Long> dates = new Vector<>();
|
Vector<Long> dates = new Vector<>();
|
||||||
get_newest_file_date_r(dir, dates);
|
get_newest_file_date_r(dir, dates);
|
||||||
Collections.sort(dates);
|
Collections.sort(dates);
|
||||||
@@ -1289,24 +1290,24 @@ public class Utils {
|
|||||||
return dates.firstElement();
|
return dates.firstElement();
|
||||||
}
|
}
|
||||||
//методы работают только с непустыми запакованными данными
|
//методы работают только с непустыми запакованными данными
|
||||||
public static Vector<Integer> unpackIntegers(String packed, String separator){
|
public static Vector<Integer> unpackIntegers(String packed, String separator) {
|
||||||
Vector<Integer> ids = new Vector<>();
|
Vector<Integer> ids = new Vector<>();
|
||||||
String[] data = packed.split(separator);
|
String[] data = packed.split(separator);
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
for (String s: data) {
|
for (String s : data) {
|
||||||
if (!s.isEmpty())
|
if (!s.isEmpty())
|
||||||
ids.add(Integer.parseInt(s));
|
ids.add(Integer.parseInt(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
public static Vector<String> unpack_s(String packed, String separator){
|
public static Vector<String> unpack_s(String packed, String separator) {
|
||||||
Vector<String> ids = new Vector<>();
|
Vector<String> ids = new Vector<>();
|
||||||
String[] data = packed.split(separator);
|
String[] data = packed.split(separator);
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
for (String s: data) {
|
for (String s : data) {
|
||||||
if (!s.isEmpty())
|
if (!s.isEmpty())
|
||||||
ids.add(s);
|
ids.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ids;
|
return ids;
|
||||||
|
|||||||
8
src/Common/Utils/Vector_.java
Normal file
8
src/Common/Utils/Vector_.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package Common.Utils;
|
||||||
|
import java.util.Vector;
|
||||||
|
public class Vector_<T> extends Vector<T> {
|
||||||
|
public Vector_(T... data){
|
||||||
|
for (T object: data)
|
||||||
|
this.add(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package TestingSystem.Common.Configuration;
|
package TestingSystem.Common.Configuration;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Database.riDBObject;
|
import Common.Database.riDBObject;
|
||||||
|
import Common.Utils.TextLog;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import TestingSystem.Common.Group.Group;
|
import TestingSystem.Common.Group.Group;
|
||||||
import TestingSystem.Common.Group.Json.GroupsJson;
|
import TestingSystem.Common.Group.Json.GroupsJson;
|
||||||
@@ -65,5 +66,8 @@ public class Configuration extends riDBObject {
|
|||||||
packedGroupsJson = c.packedGroupsJson;
|
packedGroupsJson = c.packedGroupsJson;
|
||||||
packedTestsJson = c.packedTestsJson;
|
packedTestsJson = c.packedTestsJson;
|
||||||
}
|
}
|
||||||
//-
|
//- для автоматического тестирования главным образом.
|
||||||
|
public boolean validate(TextLog log){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
package TestingSystem.SAPFOR.SapforConfiguration;
|
package TestingSystem.SAPFOR.SapforConfiguration;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
|
import Common.UI.VisualCache.ConfigurationCache;
|
||||||
|
import Common.UI.VisualCache.VisualCaches;
|
||||||
|
import Common.Utils.TextLog;
|
||||||
|
import Common.Utils.Utils;
|
||||||
|
import ProjectData.LanguageName;
|
||||||
import TestingSystem.Common.Configuration.Configuration;
|
import TestingSystem.Common.Configuration.Configuration;
|
||||||
|
import TestingSystem.Common.Group.Group;
|
||||||
|
import TestingSystem.Common.Test.Test;
|
||||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
|
|
||||||
@@ -55,4 +62,55 @@ public class SapforConfiguration extends Configuration {
|
|||||||
}
|
}
|
||||||
public SapforConfiguration() {
|
public SapforConfiguration() {
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public boolean validate(TextLog Log) {
|
||||||
|
//1. проверка цепочки команд на корректность
|
||||||
|
Vector<PassCode_2021> codes = Global.testingServer.db.sapforConfigurationCommands.getCodes(this);
|
||||||
|
if (codes.size() == 0) {
|
||||||
|
Log.Writeln_("Конфигурация:" + id + " не содержит ни одного прохода.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int first = 0;
|
||||||
|
int last = codes.size() - 1;
|
||||||
|
Vector<PassCode_2021> matches = new Vector<>();
|
||||||
|
for (int i = 0; i < codes.size(); ++i) {
|
||||||
|
PassCode_2021 code = codes.get(i);
|
||||||
|
if (code.isSapforStart()) {
|
||||||
|
if (i > first) {
|
||||||
|
Log.Writeln_("Неверная конфигурация:" + id + ": проход" +
|
||||||
|
Utils.Brackets(code.getDescription()) +
|
||||||
|
" может быть только первым!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (code.isSapforTerminal()) {
|
||||||
|
if (i < last) {
|
||||||
|
Log.Writeln_("Неверная конфигурация:" + id + ": проход " +
|
||||||
|
Utils.Brackets(code.getDescription()) +
|
||||||
|
" может быть только последним!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (matches.contains(code)) {
|
||||||
|
Log.Writeln_("Неверная конфигурация:" + id + ": проход " +
|
||||||
|
Utils.Brackets(code.getDescription()) +
|
||||||
|
" запрещено применять более одного раза!");
|
||||||
|
} else matches.add(code);
|
||||||
|
}
|
||||||
|
//2. Проверка входящих групп и тестов на корректность
|
||||||
|
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(this);
|
||||||
|
//--
|
||||||
|
Vector<Group> groups = cache.getGroups();
|
||||||
|
Vector<Test> tests = cache.getTests();
|
||||||
|
Vector<LanguageName> groupsLanguages = new Vector<>();
|
||||||
|
//-
|
||||||
|
for (Group group : groups) {
|
||||||
|
if (!groupsLanguages.contains(group.language))
|
||||||
|
groupsLanguages.add(group.language);
|
||||||
|
}
|
||||||
|
if ((groupsLanguages.size() > 1)||(!groupsLanguages.contains(LanguageName.fortran))) {
|
||||||
|
Log.Writeln_("Запуск тестов на разных языках в рамках одного пакета запрещен!\n" +
|
||||||
|
"Поддерживается пакетный режим только для языка Fortran");
|
||||||
|
}
|
||||||
|
//-
|
||||||
|
return Log.isEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import Common.Database.iDBTable;
|
|||||||
import Common.UI.DataSetControlForm;
|
import Common.UI.DataSetControlForm;
|
||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||||
|
import TestingSystem.Common.Configuration.Configuration;
|
||||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
|
import TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
|
|
||||||
|
import java.util.Vector;
|
||||||
public class SapforConfigurationCommandsDBTable extends iDBTable<SapforConfigurationCommand> {
|
public class SapforConfigurationCommandsDBTable extends iDBTable<SapforConfigurationCommand> {
|
||||||
public SapforConfigurationCommandsDBTable() {
|
public SapforConfigurationCommandsDBTable() {
|
||||||
super(SapforConfigurationCommand.class);
|
super(SapforConfigurationCommand.class);
|
||||||
@@ -20,7 +23,7 @@ public class SapforConfigurationCommandsDBTable extends iDBTable<SapforConfigura
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected DataSetControlForm createUI() {
|
protected DataSetControlForm createUI() {
|
||||||
return new DataSetControlForm(this){
|
return new DataSetControlForm(this) {
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCheckBox() {
|
public boolean hasCheckBox() {
|
||||||
return true;
|
return true;
|
||||||
@@ -68,4 +71,12 @@ public class SapforConfigurationCommandsDBTable extends iDBTable<SapforConfigura
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
public Vector<PassCode_2021> getCodes(Configuration configuration) {
|
||||||
|
Vector<PassCode_2021> res = new Vector<>();
|
||||||
|
for (SapforConfigurationCommand command : Data.values()) {
|
||||||
|
if (command.sapforconfiguration_id == configuration.id)
|
||||||
|
res.add(command.passCode);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
|
|||||||
//--
|
//--
|
||||||
protected LinkedHashMap<String, Test> testsByDescriptions = null;
|
protected LinkedHashMap<String, Test> testsByDescriptions = null;
|
||||||
protected Vector<String> testsNames_lower = null; //все тесты что участвуют здесь
|
protected Vector<String> testsNames_lower = null; //все тесты что участвуют здесь
|
||||||
protected Vector<LanguageName> groupsLanguages = null;
|
|
||||||
protected File sapfor = null;
|
protected File sapfor = null;
|
||||||
//--
|
//--
|
||||||
protected Vector<SapforTask> new_tasks = null;
|
protected Vector<SapforTask> new_tasks = null;
|
||||||
@@ -41,93 +40,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
|
|||||||
return "/icons/Start.png";
|
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) {
|
protected boolean checkTestName(Test test) {
|
||||||
String name = test.description.toLowerCase();
|
String name = test.description.toLowerCase();
|
||||||
if (testsNames_lower.contains(name)) {
|
if (testsNames_lower.contains(name)) {
|
||||||
@@ -162,7 +74,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
|
|||||||
//--
|
//--
|
||||||
testsNames_lower = new Vector<>();
|
testsNames_lower = new Vector<>();
|
||||||
testsByDescriptions = new LinkedHashMap<>();
|
testsByDescriptions = new LinkedHashMap<>();
|
||||||
groupsLanguages = new Vector<>();
|
|
||||||
//--
|
//--
|
||||||
new_tasks= new Vector<>();
|
new_tasks= new Vector<>();
|
||||||
//--
|
//--
|
||||||
@@ -185,7 +96,7 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
|
|||||||
int max_kernels = 1;
|
int max_kernels = 1;
|
||||||
for (SapforConfiguration configuration : configurations) {
|
for (SapforConfiguration configuration : configurations) {
|
||||||
max_kernels = Math.max(configuration.kernels, max_kernels);
|
max_kernels = Math.max(configuration.kernels, max_kernels);
|
||||||
if (!checkConfigurationCommands(configuration))
|
if (!(configuration.validate(Log)))
|
||||||
return false;
|
return false;
|
||||||
//-
|
//-
|
||||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(configuration);
|
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(configuration);
|
||||||
@@ -194,19 +105,6 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
|
|||||||
tests = cache.getTests();
|
tests = cache.getTests();
|
||||||
//--
|
//--
|
||||||
for (Group group : groups) {
|
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<>();
|
Vector<Test> groupTests = new Vector<>();
|
||||||
for (Test test : tests) {
|
for (Test test : tests) {
|
||||||
if (test.group_id == group.id)
|
if (test.group_id == group.id)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
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 Visual_DVM_2021.Passes.Pass_2021;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -7,7 +8,14 @@ public class TestPass extends Pass_2021<File> {
|
|||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
//определить дату изменения проекта.
|
//определить дату изменения проекта.
|
||||||
target = new File("E:\\Tests\\bugreport_1712090719\\SP");
|
// target = new File("E:\\Tests\\bugreport_1712090719\\SP");
|
||||||
Utils.getNewestFileDate(target);
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package Visual_DVM_2021.Passes;
|
package Visual_DVM_2021.Passes;
|
||||||
|
import Common.Constants;
|
||||||
public enum PassCode_2021 {
|
public enum PassCode_2021 {
|
||||||
Undefined,
|
Undefined,
|
||||||
//-
|
//-
|
||||||
@@ -1025,5 +1026,12 @@ public enum PassCode_2021 {
|
|||||||
}
|
}
|
||||||
return p + " " + name;
|
return p + " " + name;
|
||||||
}
|
}
|
||||||
|
//-- для тестирования.
|
||||||
|
public boolean isSapforStart(){
|
||||||
|
return Constants.startSapforCodes.contains(this);
|
||||||
|
}
|
||||||
|
public boolean isSapforTerminal(){
|
||||||
|
return Constants.terminalSapforCodes.contains(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user