исправление анализа вывода тестов. если число линий содержащих start и end одинаковое, то число завершенных тестов может быть нулевым, иначе неверный формат.
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -6,7 +6,10 @@
|
||||
</artifacts-to-build>
|
||||
</component>
|
||||
<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 beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
|
||||
@@ -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 =", "");
|
||||
|
||||
Reference in New Issue
Block a user