added rakefile for automatic testing

git-svn-id: http://cexception.svn.sourceforge.net/svnroot/cexception/trunk@6 50f63946-2846-0410-8d77-f904c773002e
This commit is contained in:
mvandervoord
2009-03-01 01:58:00 +00:00
parent 959e43da62
commit 707e40a386
+35
View File
@@ -0,0 +1,35 @@
HERE = File.expand_path(File.dirname(__FILE__)) + '/'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
#Tool and Lib Locations
C_COMPILER = 'gcc'
C_LIBS = ''
UNITY_DIR = 'vendor/unity/src'
#Test File To Be Created
OUT_FILE = 'test_cexceptions'
OUT_EXTENSION = '.out'
#Options
SRC_FILES = "lib/CException.c test/TestException.c test/TestException_Runner.c #{UNITY_DIR}/unity.c"
INC_DIRS = "-Ilib -Itest -I#{UNITY_DIR}"
LIB_DIRS = C_LIBS.empty? ? '' : "-L#{C_LIBS}"
SYMBOLS = '-DTEST'
CLEAN.include("#{HERE}*.out")
task :default => [:clobber, :test]
desc "performs a quick set of unit tests to confirm you're ready to go"
task :test do
puts "#{C_COMPILER} #{INC_DIRS} #{LIB_DIRS} #{SYMBOLS} #{SRC_FILES} -o #{OUT_FILE}#{OUT_EXTENSION}"
output = `#{C_COMPILER} #{INC_DIRS} #{LIB_DIRS} #{SYMBOLS} #{SRC_FILES} -o #{OUT_FILE}#{OUT_EXTENSION}`
puts output
puts "#{HERE}#{OUT_FILE}#{OUT_EXTENSION}"
output = `#{HERE}#{OUT_FILE}#{OUT_EXTENSION}`
puts output
end