| commit 736: | b7008f56813e |
| parent 735: | 8890d915e0c8 |
| branch: | default |
Wire the sample Razor repository into the tests
19 months ago
Changed (Δ1.0 KB):
raw changeset »
build.xml (27 lines added, 0 lines removed)
test/org/opensolaris/opengrok/search/SearchEngineTest.java (4 lines added, 4 lines removed)
| … | … | @@ -100,6 +100,7 @@ Use is subject to license terms. |
100 |
100 |
<property name="test.cvs" value="${test.repositories}/cvs"/> |
101 |
101 |
<property name="test.hg" value="${test.repositories}/mercurial"/> |
102 |
102 |
<property name="test.svn" value="${test.repositories}/svn"/> |
103 |
<property name="test.razor" value="${test.repositories}/razor"/> |
|
103 |
104 |
|
104 |
105 |
<available property="compileSystrayClient" classname="java.awt.TrayIcon"/> |
105 |
106 |
|
| … | … | @@ -436,6 +437,7 @@ Use is subject to license terms. |
436 |
437 |
|
437 |
438 |
<target name="-post-compile-test"> |
438 |
439 |
<antcall target="-create-svn-repository"/> |
440 |
<antcall target="-create-razor-repository"/> |
|
439 |
441 |
<!-- Change root in CVS test repository --> |
440 |
442 |
<property name="test.cvs.repo" value="${test.cvs}/cvsrepo"/> |
441 |
443 |
<property name="test.cvs.root" value="${test.cvs}/cvsroot"/> |
| … | … | @@ -492,6 +494,31 @@ Use is subject to license terms. |
492 |
494 |
</exec> |
493 |
495 |
</target> |
494 |
496 |
|
497 |
<target name="-create-razor-repository"> |
|
498 |
<delete dir="${test.razor}"/> |
|
499 |
<copy todir="${test.razor}/Razor-Simple"> |
|
500 |
<fileset dir="ext/SampleRazorRepository/UserSandbox"/> |
|
501 |
</copy> |
|
502 |
<copy todir="${test.razor}/Razor-Simple/SimpleCProgram/.razor"> |
|
503 |
<fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/> |
|
504 |
</copy> |
|
505 |
||
506 |
<!-- |
|
507 |
The support for binaries in Razor repositories is not fully |
|
508 |
functional, so the next copy target is commented out for now. |
|
509 |
--> |
|
510 |
||
511 |
<!--copy todir="${test.razor}/Razor-Simple/SimpleCProgram-BinaryRelease/.razor"> |
|
512 |
<fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/> |
|
513 |
</copy--> |
|
514 |
||
515 |
</target> |
|
516 |
||
517 |
<!-- clean up after tests --> |
|
518 |
<target name="-post-test-run"> |
|
519 |
<delete dir="${test.razor}"/> |
|
520 |
</target> |
|
521 |
||
495 |
522 |
<target name="emma-report" description="Analyze" depends="-check_emma"> |
496 |
523 |
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/> |
497 |
524 |
<emma enabled="true" > |
Up to file-list test/org/opensolaris/opengrok/search/SearchEngineTest.java:
| … | … | @@ -174,7 +174,7 @@ public class SearchEngineTest { |
174 |
174 |
instance.setSymbol("printf"); |
175 |
175 |
instance.setFile("main.c"); |
176 |
176 |
noHits = instance.search(); |
177 |
assertEquals( |
|
177 |
assertEquals(8, noHits); |
|
178 |
178 |
hits.clear(); |
179 |
179 |
instance.more(0, noHits, hits); |
180 |
180 |
for (Hit hit : hits) { |
| … | … | @@ -184,7 +184,7 @@ public class SearchEngineTest { |
184 |
184 |
|
185 |
185 |
instance.setFile("main.c OR Makefile"); |
186 |
186 |
noHits = instance.search(); |
187 |
assertEquals( |
|
187 |
assertEquals(8, noHits); |
|
188 |
188 |
|
189 |
189 |
instance = new SearchEngine(); |
190 |
190 |
instance.setFreetext("arguments"); |
| … | … | @@ -198,7 +198,7 @@ public class SearchEngineTest { |
198 |
198 |
fail("got an incorrect match: " + hit.getLine()); |
199 |
199 |
} |
200 |
200 |
} |
201 |
assertEquals( |
|
201 |
assertEquals(8, noHits); |
|
202 |
202 |
|
203 |
203 |
instance = new SearchEngine(); |
204 |
204 |
instance.setDefinition("main"); |
| … | … | @@ -212,6 +212,6 @@ public class SearchEngineTest { |
212 |
212 |
fail("got an incorrect match: " + hit.getLine()); |
213 |
213 |
} |
214 |
214 |
} |
215 |
assertEquals( |
|
215 |
assertEquals(8, noHits); |
|
216 |
216 |
} |
217 |
217 |
} |
