Skip to content

Commit 90a1ad6

Browse files
committed
Add code coverage
1 parent 98f8d21 commit 90a1ad6

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

rcljava_utils/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
plugins {
22
id "org.ros2.rcljava" version "0.4.6"
3+
id 'jacoco'
4+
id 'com.github.kt3k.coveralls' version '2.8.1'
35
}
46

57
apply plugin: 'org.ros2.rcljava'
8+
apply plugin: 'jacoco'
69

710
sourceCompatibility = 1.7
811
targetCompatibility = 1.7
@@ -35,3 +38,14 @@ ament {
3538
}
3639
}
3740
}
41+
42+
43+
test { finalizedBy jacocoTestReport }
44+
45+
jacocoTestReport {
46+
reports {
47+
xml.enabled = true // coveralls plugin depends on xml format report
48+
html.enabled = true
49+
}
50+
finalizedBy 'coveralls'
51+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.ros2.rcljava.tool;
2+
3+
import static org.junit.Assert.*;
4+
5+
import java.util.ArrayList;
6+
7+
import org.junit.After;
8+
import org.junit.AfterClass;
9+
import org.junit.Before;
10+
import org.junit.BeforeClass;
11+
import org.junit.Ignore;
12+
import org.junit.Test;
13+
import org.ros2.rcljava.RCLJava;
14+
import org.ros2.rcljava.tool.Ros2Topics;
15+
16+
public class TestRos2Topics {
17+
18+
@BeforeClass
19+
public static void setUpBeforeClass() throws Exception {
20+
}
21+
22+
@AfterClass
23+
public static void tearDownAfterClass() throws Exception {
24+
}
25+
26+
@Before
27+
public void setUp() throws Exception {
28+
}
29+
30+
@After
31+
public void tearDown() throws Exception {
32+
}
33+
34+
@Test
35+
@Ignore
36+
public final void testFullUsage() throws InterruptedException {
37+
Ros2Topics.main(new String[]{});
38+
assertEquals(true, true);
39+
}
40+
41+
@Test
42+
public final void testList() throws InterruptedException {
43+
Ros2Topics.main(new String[]{"list"});
44+
assertEquals(true, true);
45+
}
46+
47+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
*
3+
*/
4+
package com.ros2.rcljava.tool;

0 commit comments

Comments
 (0)