Overview
- related application
EMMA
Cobertura for J2me - advantage
presentation slice
Concept
- injector
- make html report
Step-by-Step
1. checkout the code(include jinjector_tool and jinjector_mobile)
- svn checkout http://jinjector.googlecode.com/svn/trunk/ jinjector-read-only
- jinjector_tool : you can build jinjector by yourself
- jinjector_mobile : run the example
2. get the related lib from web by script
./adddextrapackagesandifiles.sh (copy from jinjector_mobile/)
3. modify the build.xml
build-yourprojectname.xml -> build.xml:
- <property name="WTK" value ="c:\wtk2.6" /> -> change the value into your WTK folder
- <property name="emulator.device" value="DefaultColorPhone" /> -> you can change device by setting this value
jinjector.yourprojectname.properties:
- jars: c:/wtk2.6/lib/cldcapi10.jar... -> your_WTK_folder/lib/cldcapi10.jar...
4. put your source and test case
jinjector_mobile\src : your source
jinjector_mobile\tests_to_inject : your test case
jinjector_mobile\tests_to_inject : your test case
also you can change the value of srcdir:
< target name = "injectiontests" depends = "unittests" description = "Compiles the tests to inject" > < javac srcdir = "${basedir}/tests_to_inject" ... ... ... <target name = "compile" depends = "debug_ant, extract" description = "Compiles the source" > <javac srcdir="${basedir}/src" ... |
5. build test case with jinjector
ant build
- it can auto run the emulator from WTK
figure. auto run the emulator from WTK
figure. end of test and output the log of coverage
hint: the log will put in here in experiential
6. generate report html
- copy the lcov file into the "/src" where is your source folder
- generating the report html by genhtml command
- genhtml qq.lcov*
- open the index.html in the same folderfigure. the main page show the percentage of code coverage for each class
figure. under light the code by different color. orange=coverage, red=not coverage yet in the test case
沒有留言:
張貼留言