madrona / rad forked from atduskgreg/rad

Ruby Arduino Development: a framework for programming the Arduino physcial computing platform using Ruby -- Experimental Fork

This URL has Read+Write access

commit  10ae4b0629d369c1a9e50300c3cec2b274a2d36e
tree    8f7e15543d04b98a65c4700b0feb8f0d848cf356
parent  d167fbdb142ea5d6749ca9f7f959068ac5050bf7
rad / project_dev.rake
100644 36 lines (29 sloc) 0.854 kb
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
28
29
30
31
32
33
34
35
36
def run_tests(sketch, type)
  sh %{rake make:#{type} sketch=#{RAD_ROOT}/lib/examples/#{sketch}}
end
 
namespace :test do
  
  desc "run the framework unit tests"
  task :units do
    FileList['test/test_*.rb'].each do |test|
      sh %{ ruby #{RAD_ROOT}/#{test} }
    end
  end
  
  
  desc "iterate through all the sketches in the example directory"
  task :upload => :gather do
    @examples.each {|e| run_tests(e, "upload")}
  end
  
  desc "compile all examples to test the framework"
  task :compile => :gather do
    @examples.each {|e| run_tests(e, "compile")}
    end
  end
  
  desc "gather all tests"
  task :gather do # => "make:upload" do
    @examples = []
    @test_results = []
    Dir.entries( File.expand_path("#{RAD_ROOT}/lib/examples") ).each do |f|
      if (f =~ /\.rb$/)
        @examples << f.split('.').first
      end
  end
 
end