Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gem "minitest" and others ? #65

Open
jimc opened this issue Apr 20, 2015 · 5 comments
Open

gem "minitest" and others ? #65

jimc opened this issue Apr 20, 2015 · 5 comments

Comments

@jimc
Copy link

jimc commented Apr 20, 2015

Im so far failing to build ruby-opencv.
I ended up adding 2 gems, both seemed to bring progress,
after several rounds of raking, bundling, gemming
(kinda new at ruby, so uncertain ...)

diff --git a/Gemfile b/Gemfile
index 0cb99e2..9d71f2a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,5 +5,7 @@ group :development do
gem "hoe-gemspec"
gem "rake-compiler"
gem "yard"

  • gem "minitest"
  • gem "test-unit"
    end

diff --git a/test/test_cvbox2d.rb b/test/test_cvbox2d.rb
index ced01d7..cab2eb7 100755
--- a/test/test_cvbox2d.rb
+++ b/test/test_cvbox2d.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby

-- mode: ruby; coding: utf-8 --

-require 'test/unit'
+require 'test-unit'
require 'opencv'
require File.expand_path(File.dirname(FILE)) + '/helper'

This gets me further, into tests. where I get a coredump or 2
rake test > out 2>&1

....
/home/jimc/projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:1257: warning: assigned but unused variable - mask5
/home/jimc/projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:1833: warning: assigned but unused variable - expected_points
Loaded suite -e
Started

............E

Error: test_INTERFACE(TestCvCapture)
: StandardError: Invalid capture format.
/home/jimc/projects/ruby-opencv/test/test_cvcapture.rb:12:in `open'

/home/jimc/projects/ruby-opencv/test/test_cvcapture.rb:12:in `setup'

E
and 47 more of those.

and a segfault - quite a dump, dunno whether just to keep the pieces...

.../home/jimc/projects/ruby-opencv/test/test_cvcontourtree.rb:39: [BUG] Segmentation fault at 0x00000000000000
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0034 p:---- s:0158 e:000157 CFUNC :contour
c:0033 p:0019 s:0154 e:000153 BLOCK /home/jimc/projects/ruby-opencv/test/test_cvcontourtree.rb:39
c:0032 p:0008 s:0152 e:000151 BLOCK /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:1675
c:0031 p:0006 s:0150 e:000149 BLOCK /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:54 [FINISH]
c:0030 p:---- s:0148 e:000147 CFUNC :call
c:0029 p:0038 s:0145 e:000144 METHOD /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:1627
c:0028 p:0011 s:0141 E:002428 METHOD /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:53
c:0027 p:0088 s:0137 E:000138 BLOCK /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:1673 [FINISH]
c:0026 p:---- s:0130 e:000129 CFUNC :call
c:0025 p:0061 s:0127 e:000126 METHOD /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:1632
c:0024 p:0007 s:0123 E:001538 METHOD /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:1659
c:0023 p:0028 s:0117 E:000018 METHOD /home/jimc/.rvm/gems/ruby-2.2.1/gems/test-unit-3.0.9/lib/test/unit/assertions.rb:283
c:0022 p:0082 s:0111 E:001558 METHOD /home/jimc/projects/ruby-opencv/test/test_cvcontourtree.rb:38

@ser1zw
Copy link
Member

ser1zw commented May 13, 2015

Hi,

Sorry for the late reply.

Ruby 2.2 includes minitest and test-unit gems.
What the error say when you build ruby-opencv without adding the 2 gems to Gemfile?

@jimc
Copy link
Author

jimc commented May 13, 2015

That was day 1 of ruby, of opencv, and their combo,
so its safe to say I didnt know what I was doing.
At some point I'll take that commit out, and see what happens.

In the meantime, I added another patch, to check opencv < 3.0,
which would have saved me a bit of groping.
I'll try repurposing this ticket with it.

On Wed, May 13, 2015 at 8:55 AM, ser1zw notifications@github.com wrote:

Hi,

Sorry for the late reply.

Ruby 2.2 includes minitest
http://ruby-doc.org/stdlib-2.0/libdoc/minitest/rdoc/index.html and
test-unit
http://ruby-doc.org/stdlib-2.0/libdoc/test/unit/rdoc/index.html gems.
What the error say when you build ruby-opencv without adding the 2 gems to
Gemfile?


Reply to this email directly or view it on GitHub
#65 (comment)
.

@jimc
Copy link
Author

jimc commented May 13, 2015

ok, attachment was clipped. I'll try a pull request.

@jimc jimc closed this as completed May 13, 2015
@jimc jimc reopened this May 13, 2015
@jimc
Copy link
Author

jimc commented May 13, 2015

ok, I swapped the version<3.0 check (not yet PRd)
and the Gemfile addition the original patch seems to be needed here

[jimc@groucho ruby-opencv]$ rake
cd tmp/x86_64-linux/opencv/2.2.1
/home/jimc/.rvm/rubies/ruby-2.2.1/bin/ruby -I. ../../../../ext/opencv/extconf.rb

Check the required libraries...
checking for main() in -lstdc++... yes
checking for main() in -lopencv_calib3d... yes
checking for main() in -lopencv_contrib... yes
checking for main() in -lopencv_core... yes
checking for main() in -lopencv_features2d... yes
checking for main() in -lopencv_flann... yes
checking for main() in -lopencv_highgui... yes
checking for main() in -lopencv_imgproc... yes
checking for main() in -lopencv_legacy... yes
checking for main() in -lopencv_ml... yes
checking for main() in -lopencv_objdetect... yes
checking for main() in -lopencv_video... yes
checking for main() in -lopencv_photo... yes
checking for main() in -lopencv_gpu... yes
checking for main() in -lopencv_nonfree... yes
Check the required headers...
checking for opencv2/core/core_c.h... yes
checking for opencv2/core/core.hpp... yes
checking for opencv2/imgproc/imgproc_c.h... yes
checking for opencv2/imgproc/imgproc.hpp... yes
checking for opencv2/video/tracking.hpp... yes
checking for opencv2/features2d/features2d.hpp... yes
checking for opencv2/flann/flann.hpp... yes
checking for opencv2/calib3d/calib3d.hpp... yes
checking for opencv2/objdetect/objdetect.hpp... yes
checking for opencv2/legacy/compat.hpp... yes
checking for opencv2/legacy/legacy.hpp... yes
checking for opencv2/highgui/highgui_c.h... yes
checking for opencv2/highgui/highgui.hpp... yes
checking for opencv2/photo/photo.hpp... yes
checking for opencv2/nonfree/nonfree.hpp... yes
checking for stdarg.h... yes
creating Makefile
cd -
cd tmp/x86_64-linux/opencv/2.2.1
gmake
linking shared-object opencv.so
cd -
install -c tmp/x86_64-linux/opencv/2.2.1/opencv.so lib/opencv.so
cp tmp/x86_64-linux/opencv/2.2.1/opencv.so tmp/x86_64-linux/stage/lib/opencv.so
/home/jimc/.rvm/rubies/ruby-2.2.1/bin/ruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/test_cvbox2d.rb"; require "test/test_cvcircle32f.rb"; require "test/test_cverror.rb"; require "test/test_curve.rb"; require "test/test_cvmat.rb"; require "test/test_iplconvkernel.rb"; require "test/test_cvchain.rb"; require "test/test_cvhistogram.rb"; require "test/test_cvslice.rb"; require "test/test_cvcontourtree.rb"; require "test/test_cvpoint3d32f.rb"; require "test/test_cvhaarclassifiercascade.rb"; require "test/test_cvvideowriter.rb"; require "test/test_cvfeaturetree.rb"; require "test/test_cvsize.rb"; require "test/test_cvsize2d32f.rb"; require "test/test_cvmat_drawing.rb"; require "test/test_cvmat_dxt.rb"; require "test/test_iplimage.rb"; require "test/test_cvsurfpoint.rb"; require "test/test_trackbar.rb"; require "test/test_cvhumoments.rb"; require "test/test_cvmat_imageprocessing.rb"; require "test/test_cvline.rb"; require "test/test_cvavgcomp.rb"; require "test/test_cvseq.rb"; require "test/test_window.rb"; require "test/test_mouseevent.rb"; require "test/test_opencv.rb"; require "test/test_cvscalar.rb"; require "test/test_fisherfaces.rb"; require "test/test_cvcapture.rb"; require "test/test_pointset.rb"; require "test/test_cvmoments.rb"; require "test/test_cvtermcriteria.rb"; require "test/test_cvpoint2d32f.rb"; require "test/test_cvcontour.rb"; require "test/test_cvconnectedcomp.rb"; require "test/test_preliminary.rb"; require "test/test_lbph.rb"; require "test/test_cvrect.rb"; require "test/test_cvpoint.rb"; require "test/test_cvfont.rb"; require "test/test_cvtwopoints.rb"; require "test/test_eigenfaces.rb"; require "test/test_cvsurfparams.rb"' --
-e:1:in require': cannot load such file -- minitest/autorun (LoadError) from -e:1:in

'
rake aborted!
Command failed with status (1): [/home/jimc/.rvm/rubies/ruby-2.2.1/bin/ruby...]
/home/jimc/.rvm/gems/ruby-2.2.1/gems/hoe-3.13.1/lib/hoe/test.rb:83:in block in define_test_tasks' /home/jimc/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:ineval'
/home/jimc/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in <main>' Tasks: TOP => default => test (See full trace by running task with --trace) [jimc@groucho ruby-opencv]$ rake --trace ** Invoke default (first_time) ** Invoke test (first_time) ** Invoke compile (first_time) ** Invoke compile:x86_64-linux (first_time) ** Invoke compile:opencv:x86_64-linux (first_time) ** Invoke copy:opencv:x86_64-linux:2.2.1 (first_time) ** Invoke lib (first_time, not_needed) ** Invoke tmp/x86_64-linux/opencv/2.2.1/opencv.so (first_time, not_needed) ** Invoke tmp/x86_64-linux/opencv/2.2.1/Makefile (first_time, not_needed) ** Invoke tmp/x86_64-linux/opencv/2.2.1 (first_time, not_needed) ** Invoke ext/opencv/extconf.rb (first_time, not_needed) ** Invoke tmp/x86_64-linux/stage/lib (first_time, not_needed) ** Execute copy:opencv:x86_64-linux:2.2.1 install -c tmp/x86_64-linux/opencv/2.2.1/opencv.so lib/opencv.so cp tmp/x86_64-linux/opencv/2.2.1/opencv.so tmp/x86_64-linux/stage/lib/opencv.so ** Execute compile:opencv:x86_64-linux ** Execute compile:x86_64-linux ** Execute compile ** Execute test /home/jimc/.rvm/rubies/ruby-2.2.1/bin/ruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/test_cvbox2d.rb"; require "test/test_cvcircle32f.rb"; require "test/test_cverror.rb"; require "test/test_curve.rb"; require "test/test_cvmat.rb"; require "test/test_iplconvkernel.rb"; require "test/test_cvchain.rb"; require "test/test_cvhistogram.rb"; require "test/test_cvslice.rb"; require "test/test_cvcontourtree.rb"; require "test/test_cvpoint3d32f.rb"; require "test/test_cvhaarclassifiercascade.rb"; require "test/test_cvvideowriter.rb"; require "test/test_cvfeaturetree.rb"; require "test/test_cvsize.rb"; require "test/test_cvsize2d32f.rb"; require "test/test_cvmat_drawing.rb"; require "test/test_cvmat_dxt.rb"; require "test/test_iplimage.rb"; require "test/test_cvsurfpoint.rb"; require "test/test_trackbar.rb"; require "test/test_cvhumoments.rb"; require "test/test_cvmat_imageprocessing.rb"; require "test/test_cvline.rb"; require "test/test_cvavgcomp.rb"; require "test/test_cvseq.rb"; require "test/test_window.rb"; require "test/test_mouseevent.rb"; require "test/test_opencv.rb"; require "test/test_cvscalar.rb"; require "test/test_fisherfaces.rb"; require "test/test_cvcapture.rb"; require "test/test_pointset.rb"; require "test/test_cvmoments.rb"; require "test/test_cvtermcriteria.rb"; require "test/test_cvpoint2d32f.rb"; require "test/test_cvcontour.rb"; require "test/test_cvconnectedcomp.rb"; require "test/test_preliminary.rb"; require "test/test_lbph.rb"; require "test/test_cvrect.rb"; require "test/test_cvpoint.rb"; require "test/test_cvfont.rb"; require "test/test_cvtwopoints.rb"; require "test/test_eigenfaces.rb"; require "test/test_cvsurfparams.rb"' -- -e:1:inrequire': cannot load such file -- minitest/autorun (LoadError)
from -e:1:in `'
rake aborted!

@ser1zw
Copy link
Member

ser1zw commented May 16, 2015

Thanks.
I'll investigate the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants