From 707e40a38656a3ce9912cebefdbeea7d58a2652e Mon Sep 17 00:00:00 2001 From: mvandervoord Date: Sun, 1 Mar 2009 01:58:00 +0000 Subject: [PATCH] added rakefile for automatic testing git-svn-id: http://cexception.svn.sourceforge.net/svnroot/cexception/trunk@6 50f63946-2846-0410-8d77-f904c773002e --- rakefile.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 rakefile.rb diff --git a/rakefile.rb b/rakefile.rb new file mode 100644 index 0000000..94f5d05 --- /dev/null +++ b/rakefile.rb @@ -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 \ No newline at end of file