исправление анализа вывода тестов. если число линий содержащих start и end одинаковое, то число завершенных тестов может быть нулевым, иначе неверный формат.

This commit is contained in:
2023-12-08 01:17:45 +03:00
parent 25d5c4b7f0
commit fc20f95457
2 changed files with 20 additions and 6 deletions

View File

@@ -1061,7 +1061,7 @@ public class Utils {
}
//--
public static boolean isCrushedLine(String line) {
String l_line=line.toLowerCase();
String l_line = line.toLowerCase();
for (String crushed : Constants.crushed_cases)
if (l_line.contains(crushed))
return true;
@@ -1074,6 +1074,8 @@ public class Utils {
int complete = 0;
int errors = 0;
int total = 0;
int starts = 0;
int ends = 0;
for (String s : lines) {
String line = s.toUpperCase();
if (line.contains("COMPLETE")) {
@@ -1082,12 +1084,21 @@ public class Utils {
} else if (line.contains("ERROR")) {
errors++;
total++;
} else if (line.contains("START")) {
starts++;
} else if (line.contains("END")) {
ends++;
}
}
return new Pair<>(
(errors > 0) ? TaskState.DoneWithErrors : ((complete > 0) ? TaskState.Done : TaskState.WrongTestFormat),
(int) ((((double) complete) / total) * 100)
);
TaskState state = TaskState.Finished;
if (starts != ends) {
state = TaskState.WrongTestFormat;
} else if (errors > 0) {
state = TaskState.DoneWithErrors;
}else {
state = TaskState.Done;
}
return new Pair<>( state, (int) ((((double) complete) / total) * 100));
}
public static Pair<TaskState, Integer> analyzePerformance(List<String> lines) {
StringTemplate stringTemplate = new StringTemplate("Verification =", "");