rakefile 1.5 KB
Newer Older
1 2 3 4
# ==========================================
#   Unity Project - A Test Framework for C
#   Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
#   [Released under MIT License. Please refer to license.txt for details]
5
# ==========================================
6

7
UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/'
G
greg-williams 已提交
8

9
require 'rake'
G
greg-williams 已提交
10
require 'rake/clean'
11 12 13 14 15 16 17 18 19 20 21 22
require UNITY_ROOT + 'rakefile_helper'

TEMP_DIRS = [
	File.join(UNITY_ROOT, 'build')
]

TEMP_DIRS.each do |dir|
  directory(dir)
  CLOBBER.include(dir)
end

task :prepare_for_tests => TEMP_DIRS
G
greg-williams 已提交
23 24 25

include RakefileHelpers

26
# Load proper GCC as defult configuration
27
DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml'
28
configure_toolchain(DEFAULT_CONFIG_FILE)
G
greg-williams 已提交
29

M
mkarlesky 已提交
30
desc "Test unity with its own unit tests"
31
task :unit => [:prepare_for_tests] do
32
  run_tests get_unit_test_files
G
greg-williams 已提交
33 34
end

35 36 37 38 39
desc "Test unity's helper scripts"
task :scripts => [:prepare_for_tests] do
  Dir['test/test_*.rb'].each do |scriptfile|
    require "./"+scriptfile
  end
40 41
end

42 43 44
desc "Generate test summary"
task :summary do
  report_summary
G
greg-williams 已提交
45 46
end

47
desc "Build and test Unity"
48
task :all => [:clean, :prepare_for_tests, :scripts, :unit, :summary]
49
task :default => [:clobber, :all]
50 51
task :ci => [:no_color, :default]
task :cruise => [:no_color, :default]
G
greg-williams 已提交
52

53 54 55
desc "Load configuration"
task :config, :config_file do |t, args|
  configure_toolchain(args[:config_file])
G
greg-williams 已提交
56
end
57 58

task :no_color do
59
  $colour_output = false
60
end