Skip to content

Commit 4634d54

Browse files
committed
Pull request fixes
Pull request fixes Added some fixes Removed file fixing pom Fixed checkstyle Fix travis
1 parent c02ac8d commit 4634d54

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

tmc-langs-qmake/pom.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
<version>0.7.7-SNAPSHOT</version>
88
</parent>
99

10-
<properties>
11-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12-
<maven.compiler.source>1.7</maven.compiler.source>
13-
<maven.compiler.target>1.7</maven.compiler.target>
14-
<tmc.basedir>../target</tmc.basedir>
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
<tmc.basedir>../target</tmc.basedir>
1513
</properties>
16-
14+
1715
<artifactId>tmc-langs-qmake</artifactId>
1816
<packaging>jar</packaging>
1917

tmc-langs-qmake/src/main/java/fi/helsinki/cs/tmc/langs/qmake/QTestResultParser.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ private List<String> parsePoints(Element testcase) {
164164
Element desc = (Element) message.getElementsByTagName("Description").item(0);
165165
String text = desc.getTextContent();
166166
if (text.matches("^(TMC:.*)")) {
167-
String[] split = text.split("\\.");
168-
String result = split[1];
169-
for (int j = 2; j < split.length; j++) {
170-
result += "." + split[j];
171-
}
167+
String result = text.substring(text.indexOf(".") + 1);
172168
points.add(result);
173169
}
174170
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
package fi.helsinki.cs.tmc.langs.qmake;
3+
4+
5+
public class QmakeBuildException extends RuntimeException {
6+
7+
QmakeBuildException(java.lang.Exception exception) {
8+
System.err.println(exception);
9+
}
10+
11+
}

tmc-langs-qmake/src/main/java/fi/helsinki/cs/tmc/langs/qmake/QmakePlugin.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ public RunResult runTests(Path path) {
129129
log.error("Building project with qmake failed: {}", qmakeBuild.errorOutput);
130130
return filledFailure(qmakeBuild.errorOutput);
131131
}
132-
} catch (Exception e) {
132+
} catch (IOException | InterruptedException e) {
133133
log.error("Building project with qmake failed", e);
134-
throw new RuntimeException(e);
134+
throw new QmakeBuildException(e);
135135
}
136136

137137
try {
@@ -140,9 +140,9 @@ public RunResult runTests(Path path) {
140140
log.error("Building project with make failed: {}", makeBuild.errorOutput);
141141
return filledFailure(makeBuild.errorOutput);
142142
}
143-
} catch (Exception e) {
143+
} catch (IOException | InterruptedException e) {
144144
log.error("Building project with make failed", e);
145-
throw new RuntimeException(e);
145+
throw new QmakeBuildException(e);
146146
}
147147

148148
Path testResults = path.resolve(TMC_TEST_RESULTS);
@@ -160,9 +160,9 @@ public RunResult runTests(Path path) {
160160
log.error("Failed to get test output at {}", testResults);
161161
return filledFailure(testRun.output);
162162
}
163-
} catch (Exception e) {
163+
} catch (IOException | InterruptedException e) {
164164
log.error("Testing with make check failed", e);
165-
throw new RuntimeException(e);
165+
throw new QmakeBuildException(e);
166166
}
167167

168168
QTestResultParser parser = new QTestResultParser();
@@ -197,7 +197,7 @@ private Path makeShadowBuildDir(Path dir) {
197197
return buildDir.toPath();
198198
}
199199

200-
private ProcessResult buildWithQmake(Path dir) throws Exception {
200+
private ProcessResult buildWithQmake(Path dir) throws IOException, InterruptedException {
201201
String qmakeArguments = "CONFIG+=test";
202202
Path pro = getProFile(dir.getParent());
203203
String[] qmakeCommand = {"qmake", qmakeArguments, pro.toString()};
@@ -206,7 +206,7 @@ private ProcessResult buildWithQmake(Path dir) throws Exception {
206206
return run(qmakeCommand, dir);
207207
}
208208

209-
private ProcessResult buildWithMake(Path dir) throws Exception {
209+
private ProcessResult buildWithMake(Path dir) throws IOException, InterruptedException {
210210
String[] makeCommand = {"make"};
211211
log.info("Building project with command {}", Arrays.deepToString(makeCommand));
212212
return run(makeCommand, dir);
@@ -226,7 +226,7 @@ public void clean(Path path) {
226226
}
227227
}
228228

229-
private ProcessResult run(String[] command, Path dir) throws Exception {
229+
private ProcessResult run(String[] command, Path dir) throws IOException, InterruptedException {
230230
ProcessRunner runner = new ProcessRunner(command, dir);
231231
return runner.call();
232232
}

tmc-langs-util/src/main/java/fi/helsinki/cs/tmc/langs/util/ProjectType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
import fi.helsinki.cs.tmc.langs.java.maven.MavenPlugin;
88
import fi.helsinki.cs.tmc.langs.make.MakePlugin;
99
import fi.helsinki.cs.tmc.langs.python3.Python3Plugin;
10-
import fi.helsinki.cs.tmc.langs.r.RPlugin;
1110
import fi.helsinki.cs.tmc.langs.qmake.QmakePlugin;
11+
import fi.helsinki.cs.tmc.langs.r.RPlugin;
12+
1213

1314

1415
import org.slf4j.Logger;

0 commit comments

Comments
 (0)