<< | Index | >>
* analysisparse 3 Failures 82% * chapterparse 6 Failures 62% * comarketing 1 Failure 91% * docdata 1 Error 25% * export 2 Failures 1 Error 48% * fiparse 11 Failures 94 Errors 59% * fipdf Error (stop) * fulltext (no test-case) * meddata Error (stop) * readonly (no test-case) * swissreg 2 Errors 64%
Next
Check each test-case file
* test_fachinfo_doc_parser.rb 89 Errors
* test_fachinfo_hpricot.rb 2 Failures
* test_fachinfo_pdf.rb Error (stop)
* test_fiparse.rb 1 Error
* test_indications.rb 1 Error
* test_minifi.rb 7 Failures 1 Error We do not need this anymore
* test_patinfo_hpricot.rb 1 Failure
masa@masa ~/ywesee/oddb.org/ext/fiparse/test $ ruby test_fachinfo_doc_parser.rb ... 89) Error: test_registration_owner9(TestFachinfoDocParser9): NoMethodError: undefined method `create_parser' for Rwv2:Module test_fachinfo_doc_parser.rb:1048:in `setup' 89 tests, 0 assertions, 0 failures, 89 errors
Note
test.rb
require 'rwv2' require 'rwv2/handlers' class TextHandler < Rwv2::TextHandler def run_of_text(text, character_properties) puts text end end parser = Rwv2.create_parser('test.doc') parser.set_text_handler(TextHandler.new) parser.parse
Note
Result
masa@masa ~/work $ ruby test.rb /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rwv2 (LoadError) from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from test.rb:3
Experiment
/usr/lib64/ruby/gems/1.8/gems/rwv2-0.6.0/lib/rwv2/rwv2.rb
#require 'rwv2'
test.rb
require 'rwv2/rwv2' require 'rwv2/handlers' class TextHandler < Rwv2::TextHandler def run_of_text(text, character_properties) puts text end end parser = Rwv2.create_parser('test.doc') parser.set_text_handler(TextHandler.new) parser.parse
Result
masa@masa ~/work $ ruby test.rb /usr/lib64/ruby/gems/1.8/gems/rwv2-0.6.0/lib/rwv2/rwv2.rb:29: warning: already initialized constant VERSION test.rb:13: undefined method `create_parser' for Rwv2:Module (NoMethodError)
Note
Memo
Install wv2
$ sudo emerge wv2
Compile rwv2 extended Ruby library
masa@masa ~/ywesee/rwv2/ext/rwv2 $ ls extconf.rb include MANIFEST mkmf.log rwv2.cpp rwv2_handlers.cpp rwv2_parser.cpp rwv2_properties.cpp masa@masa ~/ywesee/rwv2/ext/rwv2 $ ruby extconf.rb checking for main() in -lwv2... yes creating Makefile masa@masa ~/ywesee/rwv2/ext/rwv2 $ make g++ -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I./include -fPIC -march=core2 -O2 -pipe -fno-strict-aliasing -fPIC -c rwv2.cpp g++ -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I./include -fPIC -march=core2 -O2 -pipe -fno-strict-aliasing -fPIC -c rwv2_handlers.cpp g++ -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I./include -fPIC -march=core2 -O2 -pipe -fno-strict-aliasing -fPIC -c rwv2_parser.cpp g++ -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I./include -fPIC -march=core2 -O2 -pipe -fno-strict-aliasing -fPIC -c rwv2_properties.cpp x86_64-pc-linux-gnu-gcc -shared -o rwv2.so rwv2.o rwv2_handlers.o rwv2_parser.o rwv2_properties.o -L. -L/usr/lib64 -Wl,-R/usr/lib64 -L./lib -L. -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby18 -lwv2 -lstdc++ -lrt -ldl -lcrypt -lm -lc masa@masa ~/ywesee/rwv2/ext/rwv2 $ ls extconf.rb Makefile mkmf.log rwv2_handlers.cpp rwv2.o rwv2_parser.o rwv2_properties.o include MANIFEST rwv2.cpp rwv2_handlers.o rwv2_parser.cpp rwv2_properties.cpp rwv2.so
Note
Install
masa@masa ~/ywesee/rwv2 $ sudo ruby install.rb config install.rb: entering config phase... ---> lib ---> lib/rwv2 <--- lib/rwv2 <--- lib ---> ext ---> ext/rwv2 /usr/bin/ruby18 /home/masa/ywesee/rwv2/ext/rwv2/extconf.rb checking for main() in -lwv2... yes creating Makefile ---> ext/rwv2/include <--- ext/rwv2/include <--- ext/rwv2 <--- ext install.rb: config done. masa@masa ~/ywesee/rwv2 $ sudo ruby install.rb setup install.rb: entering setup phase... ---> lib ---> lib/rwv2 <--- lib/rwv2 <--- lib ---> ext ---> ext/rwv2 make x86_64-pc-linux-gnu-gcc -shared -o rwv2.so rwv2.o rwv2_handlers.o rwv2_parser.o rwv2_properties.o -L. -L/usr/lib64 -Wl,-R/usr/lib64 -L./lib -L. -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby18 -lwv2 -lstdc++ -lrt -ldl -lcrypt -lm -lc ---> ext/rwv2/include <--- ext/rwv2/include <--- ext/rwv2 <--- ext install.rb: setup done. masa@masa ~/ywesee/rwv2 $ sudo ruby install.rb install install.rb: entering install phase... ---> lib mkdir -p /usr/lib64/ruby/site_ruby/1.8/ ---> lib/rwv2 mkdir -p /usr/lib64/ruby/site_ruby/1.8/rwv2 install handlers.rb /usr/lib64/ruby/site_ruby/1.8/rwv2 install rwv2.rb /usr/lib64/ruby/site_ruby/1.8/rwv2 <--- lib/rwv2 <--- lib ---> ext ---> ext/rwv2 mkdir -p /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/. install rwv2.so /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/. ---> ext/rwv2/include <--- ext/rwv2/include <--- ext/rwv2 <--- ext install.rb: install done.
Experiment
test.rb
require 'rwv2' require 'rwv2/handlers' class TextHandler < Rwv2::TextHandler def run_of_text(text, character_properties) puts text end end parser = Rwv2.create_parser('test.doc') parser.set_text_handler(TextHandler.new) parser.parse
masa@masa ~/work $ ls test.doc test.rb
Result
masa@masa ~/work $ ruby test.rb hello
Note
Run test_fachinfo_doc_parser.rb
masa@masa ~/ywesee/oddb.org/ext/fiparse/test $ ruby test_fachinfo_doc_parser.rb /usr/lib64/ruby/site_ruby/1.8/rwv2/rwv2.rb:28: warning: already initialized constant VERSION Loaded suite test_fachinfo_doc_parser Started ......FF.FFFFFFFF...F..FFFFFF.F.FFFF>------------------------------------------------------------------------ Disktest (10 �g< >------------------------------------------------------------------------ Disktest (10 µ< F.F.F.FFF..FF..F..F....FF.FF..FFF..F.FF.FF.F.FFFFFFtest_fachinfo_doc_parser.rb:1048: [BUG] Segmentation fault ruby 1.8.6 (2009-06-08) [x86_64-linux] Abgebrochen
Note
Next
Interim report
Result
masa@masa ~/ywesee/oddb.org/ext/fiparse/test $ rcov test_fachinfo_doc_parser.rb -t /usr/lib64/ruby/site_ruby/1.8/rwv2/rwv2.rb:28: warning: already initialized constant VERSION Loaded suite /usr/bin/rcov Started ........... >------------------------------------------------------------------------ Disktest (10 �g< >------------------------------------------------------------------------ Disktest (10 µ< ...........F. Finished in 1.823073 seconds. 1) Failure: test_company5(TestFachinfoDocParser5) [./test_fachinfo_doc_parser.rb:401]: <"Salmon Pharma"> expected but was <"Salmon Pharma\n\n\n\nZusammensetzung">. 24 tests, 120 assertions, 1 failures, 0 errors 54.2% 37 file(s) 9596 Lines 7452 LOC
Updated
Result
masa@masa ~/ywesee/oddb.org/ext/fiparse/test $ ruby test_fachinfo_doc_parser.rb .... 87 tests, 359 assertions, 17 failures, 1 errors
Note
class TestFachinfoDocParser9 < Test::Unit::TestCase ...
Next
1) Failure: test_composition10(TestFachinfoDocParser10) [test_fachinfo_doc_parser.rb:1083]: <nil> expected to be an instance of <ODDB::Text::Chapter> but was <NilClass>.
Problem
Memo
Code structure (pattern) of rwv2
The sample is below
require 'rwv2' require 'rwv2/handlers' #require '/usr/lib64/ruby/gems/1.8/gems/rwv2-0.6.0/lib/rwv2/rwv2.rb' class TextHandler < Rwv2::TextHandler def run_of_text(text, character_properties) puts text end end parser = Rwv2.create_parser('test.doc') parser.set_text_handler(TextHandler.new) parser.parse
Note