File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
tmc-plugin/src/fi/helsinki/cs/tmc/data/serialization/cresultparser Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,13 @@ private void addValgrindOutput() throws FileNotFoundException {
129
129
String parentOutput = "" ; // Contains total amount of memory used and such things. Useful if we later want to add support for testing memory usage
130
130
String [] outputs = new String [tests .size ()];
131
131
int [] pids = new int [tests .size ()];
132
+ int [] errors = new int [tests .size ()];
132
133
for (int i = 0 ; i < outputs .length ; i ++) {
133
134
outputs [i ] = "" ;
134
135
}
135
136
137
+ Pattern errpat = Pattern .compile ("ERROR SUMMARY: ([0-9]+)" );
138
+
136
139
String line = scanner .nextLine ();
137
140
int firstPID = parsePID (line );
138
141
parentOutput += "\n " + line ;
@@ -146,11 +149,18 @@ private void addValgrindOutput() throws FileNotFoundException {
146
149
parentOutput += "\n " + line ;
147
150
} else {
148
151
outputs [findIndex (pid , pids )] += "\n " + line ;
152
+ Matcher m = errpat .matcher (line );
153
+ if (m .find ()) {
154
+ errors [findIndex (pid , pids )] = Integer .parseInt (m .group (1 ));
155
+ }
149
156
}
150
157
}
151
158
scanner .close ();
152
159
153
160
for (int i = 0 ; i < outputs .length ; i ++) {
161
+ if (errors [i ] == 0 ) {
162
+ outputs [i ] = "" ;
163
+ }
154
164
tests .get (i ).setValgrindTrace (outputs [i ]);
155
165
}
156
166
}
You can’t perform that action at this time.
0 commit comments