File tree Expand file tree Collapse file tree 4 files changed +7
-12
lines changed
main/java/fi/helsinki/cs/tmc/langs/r
test/java/fi/helsinki/cs/tmc/langs/r Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ private String[] getTestCommand() {
156156
157157 private String [] getAvailablePointsCommand () {
158158 String [] rscr = new String [] {"Rscript" , "-e" };
159- String [] command = new String [] {"\" library(' tmcRtestrunner' );"
159+ String [] command = new String [] {"\" library(tmcRtestrunner);"
160160 + "getAvailablePoints(\" $PWD\" )\" " };
161161 return ArrayUtils .addAll (rscr , command );
162162 }
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ private TestResult toTestResult(JsonNode node) {
6767 backTrace .add (line .asText ());
6868 }
6969
70- boolean passed = node .get ("status" ).asText ().equals ("passed " );
70+ boolean passed = node .get ("status" ).asText ().equals ("pass " );
7171
7272 return new TestResult (
7373 node .get ("name" ).asText (),
Original file line number Diff line number Diff line change @@ -23,16 +23,12 @@ public static void main(String[] args) {
2323
2424 //For now, add the path you want to test here fully,
2525 //for example: pathToGithubFolder/tmc-r/example_projects/example_project1
26-
26+ String exampleProjectLocation = "/example_projects/example_project1" ;
27+ Path path = Paths .get (exampleProjectLocation );
28+ RunResult runRes = runTests (path );
29+ printTestResult (runRes );
30+ RunResult rr ;
2731
28- /* try {
29- rr = new RTestResultParser(path).parse();
30- for (TestResult tr : rr.testResults) {
31- System.out.println(tr.toString());
32- }
33- } catch (IOException e) {
34- System.out.println("Something wrong: " + e.getMessage());
35- }*/
3632 }
3733
3834 public static void printTestResult (RunResult rr ) {
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ public void testThatParseSeemsToWorkOnExampleJson() {
3232 assertEquals (22 , rr .testResults .size ());
3333
3434 for (TestResult tr : rr .testResults ) {
35- System .out .println (tr );
3635 if (tr .getName ().equals ("Addition works" )) {
3736 assertTrue (tr .isSuccessful ());
3837 assertEquals (2 , tr .points .size ());
You can’t perform that action at this time.
0 commit comments