Make sure that examples get run with ci, and using appropriate settings.

This commit is contained in:
Mark VanderVoord
2026-05-29 10:29:30 -04:00
parent 444fbda72a
commit dd70d40adf
4 changed files with 43 additions and 28 deletions
+15 -11
View File
@@ -28,30 +28,30 @@ include RakefileHelpers
# Load proper GCC as defult configuration
DEFAULT_CONFIG_FILE = 'gcc_64_auto_stdint.yml'
configure_toolchain(DEFAULT_CONFIG_FILE)
$unity_test_config_file = DEFAULT_CONFIG_FILE
############# ALL THE SELF-TESTS WE CAN PERFORM
namespace :test do
desc "Build and test Unity"
task :all => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:fixture', 'test:memory', 'test:summary']
task :ci => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:make', 'test:fixture', 'test:memory', 'test:summary']
task :ci => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:make', 'test:fixture', 'test:memory', 'test:examples', 'test:summary']
desc "Test unity with its own unit tests"
task :unit => [:prepare_for_tests] do
task :unit => [:config_toolchain, :prepare_for_tests] do
run_tests unit_test_files
end
namespace :unit do
unit_test_files.each do |f|
desc "test this unit only"
task File.basename(f,'.c').sub('test_unity_','') => [:prepare_for_tests] do
task File.basename(f,'.c').sub('test_unity_','') => [:config_toolchain, :prepare_for_tests] do
run_tests [f]
end
end
end
desc "Test unity's helper scripts"
task :scripts => [:prepare_for_tests] do
task :scripts => [:config_toolchain, :prepare_for_tests] do
begin
Dir['tests/test_*.rb'].each do |scriptfile|
require "./"+scriptfile
@@ -66,27 +66,27 @@ namespace :test do
end
desc "Test unity triggered from make"
task :make => [:prepare_for_tests] do
task :make => [:config_toolchain, :prepare_for_tests] do
run_make_tests()
end
desc "Test unity fixture addon"
task :fixture => [:prepare_for_tests] do
task :fixture => [:config_toolchain, :prepare_for_tests] do
test_fixtures()
end
desc "Test unity memory addon"
task :memory => [:prepare_for_tests] do
task :memory => [:config_toolchain, :prepare_for_tests] do
test_memory()
end
desc "Test unity examples"
task :examples => [:prepare_for_tests] do
task :examples => [:config_toolchain, :prepare_for_tests] do
run_examples
end
desc "Run all rspecs"
task :spec => [:prepare_for_tests] do
task :spec => [:config_toolchain, :prepare_for_tests] do
output = execute("rspec spec/**/*_spec.rb", true)
rspec_ok = $?.exitstatus.zero?
report output
@@ -115,7 +115,11 @@ task :default => [:clobber, :all]
desc "Load configuration"
task :config, :config_file do |t, args|
configure_toolchain(args[:config_file])
$unity_test_config_file = args[:config_file]
end
task :config_toolchain do
configure_toolchain($unity_test_config_file)
end
task :no_color do