rakefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # ==========================================
  2. # Unity Project - A Test Framework for C
  3. # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
  4. # [Released under MIT License. Please refer to license.txt for details]
  5. # ==========================================
  6. UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/'
  7. $verbose = false
  8. require 'rake'
  9. require 'rake/clean'
  10. require UNITY_ROOT + 'rakefile_helper'
  11. require 'rspec/core/rake_task'
  12. TEMP_DIRS = [
  13. File.join(UNITY_ROOT, 'build'),
  14. File.join(UNITY_ROOT, 'sandbox')
  15. ]
  16. TEMP_DIRS.each do |dir|
  17. directory(dir)
  18. CLOBBER.include(dir)
  19. end
  20. task :prepare_for_tests => TEMP_DIRS
  21. include RakefileHelpers
  22. # Load proper GCC as defult configuration
  23. DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml'
  24. configure_toolchain(DEFAULT_CONFIG_FILE)
  25. desc "Test unity with its own unit tests"
  26. task :unit => [:prepare_for_tests] do
  27. run_tests get_unit_test_files
  28. end
  29. desc "Test unity's helper scripts"
  30. task :scripts => [:prepare_for_tests] do
  31. Dir['tests/test_*.rb'].each do |scriptfile|
  32. require "./"+scriptfile
  33. end
  34. end
  35. desc "Run all rspecs"
  36. RSpec::Core::RakeTask.new(:spec) do |t|
  37. t.pattern = 'spec/**/*_spec.rb'
  38. end
  39. desc "Generate test summary"
  40. task :summary do
  41. report_summary
  42. end
  43. desc "Build and test Unity"
  44. task :all => [:clean, :prepare_for_tests, :scripts, :unit, :summary]
  45. task :default => [:clobber, :all]
  46. task :ci => [:no_color, :default]
  47. task :cruise => [:no_color, :default]
  48. desc "Load configuration"
  49. task :config, :config_file do |t, args|
  50. configure_toolchain(args[:config_file])
  51. end
  52. task :no_color do
  53. $colour_output = false
  54. end
  55. task :verbose do
  56. $verbose = true
  57. end