Skip to content

Commit 9c01c25

Browse files
anttihaaptmoo
authored andcommitted
Updated runTests to use function and RTestResultParser to use new json format.
1 parent 768103c commit 9c01c25

File tree

4 files changed

+277
-206
lines changed

4 files changed

+277
-206
lines changed

tmc-langs-r/runTests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
#Currently this script needs to be run at project root!
3-
/usr/bin/Rscript -e "library(tmcRtestrunner);run_tests_with_default(TRUE)"
3+
/usr/bin/Rscript -e "library(tmcRtestrunner);run_tests()"

tmc-langs-r/src/main/java/fi/helsinki/cs/tmc/langs/r/RTestResultParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private List<TestResult> getTestResults() throws IOException {
4848

4949
List<TestResult> results = new ArrayList<>();
5050

51-
JsonNode tree = mapper.readTree(json);
51+
JsonNode tree = mapper.readTree(json).get("testResults");
5252
for (JsonNode node : tree) {
5353
results.add(toTestResult(node));
5454
}

tmc-langs-r/src/test/java/fi/helsinki/cs/tmc/langs/r/RTestResultParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void testThatParseSeemsToWorkOnExampleJson() {
3434
for (TestResult tr : rr.testResults) {
3535
if (tr.getName().equals("Addition works")) {
3636
assertTrue(tr.isSuccessful());
37-
assertEquals(2, tr.points.size());
37+
assertEquals(3, tr.points.size());
3838
assertTrue(tr.points.contains("r1.1"));
3939
assertTrue(tr.points.contains("r1.2"));
4040
}

0 commit comments

Comments
 (0)