Rakefile in ardtweeno-0.3.1 vs Rakefile in ardtweeno-0.4.0

- old
+ new

@@ -1,18 +1,20 @@ -require 'rubygems' +#################################################################################################### +# @author David Kirwan https://github.com/davidkirwan/ardtweeno +# @description Ardtweeno Gem Rakefile +# +# @date 02-07-2013 +#################################################################################################### begin require 'bundler' + Bundler::GemHelper.install_tasks rescue Exception => e - puts 'bundler gem not found, please install bundler and try again.' - exit + raise 'bundler gem not found, please install bundler and try again.' end - -Bundler::GemHelper.install_tasks - task :default => 'menu' task :menu do puts welcomeMsg = <<-MSG rake build # Build ardtweeno-x.x.x.gem into the pkg directory @@ -20,10 +22,20 @@ rake test # Run the unit testing suite on this gem. MSG end desc "Run the unit testing suite on this gem." -task :test do - +task :test => :tty0tty do require "./test/test_helper.rb" +end +# Build the tty0tty binary before running tests +task :tty0tty => :clean_tty0tty do + thePath = File.dirname(__FILE__) + "/test/debug/tty0tty-1.1/pts/" + sh "gcc -Wall -O2 -D_GNU_SOURCE #{thePath}tty0tty.c -o #{thePath}tty0tty" +end + +# Clean the build before compiling +task :clean_tty0tty do + thePath = File.dirname(__FILE__) + "/test/debug/tty0tty-1.1/pts/" + sh "rm -rf #{thePath}tty0tty #{thePath}*.o #{thePath}core" end