bsdcontrol.rb/Rakefile.rb

31 lines
604 B
Ruby
Raw Normal View History

2024-05-12 05:59:38 +02:00
# frozen_string_literal: true
require 'bundler/setup'
require 'rake/extensiontask'
Rake::ExtensionTask.new('bsdcontrol.rb')
2024-03-01 02:29:43 +01:00
task default: %w[clobber compile test]
2024-03-07 05:34:34 +01:00
2024-05-12 06:09:26 +02:00
namespace :format do
2024-05-12 05:59:38 +02:00
desc 'Run clang-format'
2024-05-12 06:09:26 +02:00
task :clang do
2024-05-12 05:59:38 +02:00
sh 'clang-format -style=file:.clang-format -i ext/bsdcontrol.rb/*.c'
end
2024-05-12 06:09:26 +02:00
desc 'Run rubocop'
task :ruby do
sh 'bundle exec rubocop -A'
end
2024-03-07 05:34:34 +01:00
end
2024-03-08 00:27:20 +01:00
namespace :test do
2024-05-12 05:59:38 +02:00
desc 'Run unprivileged tests'
2024-03-08 00:27:20 +01:00
task :unprivileged do
2024-05-12 05:59:38 +02:00
sh './bin/run-unprivileged-tests'
2024-03-08 00:27:20 +01:00
end
2024-05-12 05:59:38 +02:00
desc 'Run superuser tests'
2024-03-08 00:27:20 +01:00
task :superuser do
2024-05-12 05:59:38 +02:00
sh './bin/run-superuser-tests'
2024-03-08 00:27:20 +01:00
end
end