Skip to content

Commit fa2f480

Browse files
authored
Merge pull request #1673 from vladak/ctags_indexerrepotest
use ctags binary from RuntimeEnvironment in IndexerRepoTest.java
2 parents 3f6755e + cbad2d0 commit fa2f480

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

test/org/opensolaris/opengrok/index/IndexerRepoTest.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ public class IndexerRepoTest {
4646
TestRepository repository;
4747
private final String ctagsProperty = "org.opensolaris.opengrok.analysis.Ctags";
4848

49-
@BeforeClass
50-
public static void setUpClass() throws Exception {
51-
assertTrue("No point in running indexer tests without valid ctags",
52-
RuntimeEnvironment.getInstance().validateExuberantCtags());
53-
}
54-
55-
@AfterClass
56-
public static void tearDownClass() throws Exception {
57-
}
58-
5949
@Before
6050
public void setUp() throws IOException {
6151
repository = new TestRepository();
@@ -79,7 +69,7 @@ private void checkNumberOfThreads() {
7969
Thread[] threads = new Thread[mainGroup.activeCount()];
8070
mainGroup.enumerate(threads);
8171
for (int i = 0; i < threads.length; i++) {
82-
if (threads[i].getName() == null) {
72+
if (threads[i] == null || threads[i].getName() == null) {
8373
continue;
8474
}
8575
assertEquals(false, threads[i].getName().contains("renamed-handling"));
@@ -93,11 +83,11 @@ public void testMainWithH() throws IOException {
9383
env.setCtags(System.getProperty(ctagsProperty, "ctags"));
9484
if (env.validateExuberantCtags()) {
9585
String[] argv = {"-S", "-H", "-s", repository.getSourceRoot(),
96-
"-d", repository.getDataRoot(), "-v"};
86+
"-d", repository.getDataRoot(), "-v", "-c", env.getCtags()};
9787
Indexer.main(argv);
9888
checkNumberOfThreads();
9989
} else {
100-
System.out.println("Skipping test. Could not find a ctags I could use in path.");
90+
System.out.println("Skipping test. Could not find a ctags I could use.");
10191
}
10292
}
10393

@@ -108,11 +98,11 @@ public void testMainWithoutH() throws IOException {
10898
env.setCtags(System.getProperty(ctagsProperty, "ctags"));
10999
if (env.validateExuberantCtags()) {
110100
String[] argv = {"-S", "-P", "-s", repository.getSourceRoot(),
111-
"-d", repository.getDataRoot(), "-v"};
101+
"-d", repository.getDataRoot(), "-v", "-c", env.getCtags()};
112102
Indexer.main(argv);
113103
checkNumberOfThreads();
114104
} else {
115-
System.out.println("Skipping test. Could not find a ctags I could use in path.");
105+
System.out.println("Skipping test. Could not find a ctags I could use.");
116106
}
117107
}
118108
}

0 commit comments

Comments
 (0)