File: test_sample_projects.rb

package info (click to toggle)
ruby-mkrf 0.2.3+dfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,752 kB
  • ctags: 4,291
  • sloc: ansic: 12,494; ruby: 6,984; sh: 790; yacc: 374; makefile: 57; cpp: 10
file content (27 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require File.dirname(__FILE__) + '/../abstract_unit'

class TestSampleProjects < Test::Unit::TestCase
  SAMPLES_DIR = File.dirname(__FILE__) + '/../sample_files'
  
  SAMPLE_LIBS = {
    :trivial => "/libtrivial/ext/libtrivial.#{Config::CONFIG['DLEXT']}",
    :syck =>    "/syck-0.55/ext/ruby/ext/syck/syck.#{Config::CONFIG['DLEXT']}",
    :libxml =>  "/libxml-ruby-0.3.8/ext/xml/libxml_so.#{Config::CONFIG['DLEXT']}"
  }
  
  # Set to true for full command line output
  @@debug = true
  
  SAMPLE_LIBS.each do |k,v|
    define_method("test_that_#{k}_compiles") do
#      silence_command_line do
        system("rake test:samples:clobber PROJECT=#{k}")
#      end
      assert_creates_file(SAMPLES_DIR + v) do
#        silence_command_line do 
          system("rake test:samples:#{k}")
#        end
      end
    end
  end
end