require "rake/testtask" HERE = __dir__ desc "Creates the base :test task" Rake::TestTask.new do |t| t.pattern = "test/test_*.rb" end namespace :t do desc "Runs Voicemeeter basic tests" task :basic do ENV["KIND"] = "basic" Rake::Task[:test].invoke end desc "Runs Voicemeeter banana tests" task :banana do ENV["KIND"] = "banana" Rake::Task[:test].invoke end desc "Runs Voicemeeter potato tests" task :potato do ENV["KIND"] = "potato" Rake::Task[:test].invoke end end task default: ["t:potato"] task basic: ["t:basic"] task banana: ["t:banana"] task potato: ["t:potato"] task :all do Rake.application.in_namespace(:t) { |namespace| namespace.tasks.each { |t| t.invoke and Rake::Task[:test].reenable } } end namespace :e do desc "Runs the events example" task :events do filepath = File.join(HERE, "examples", "events", "main.rb") ruby filepath end desc "Runs the midi example" task :midi do filepath = File.join(HERE, "examples", "midi", "main.rb") ruby filepath end desc "Runs the obs example" task :obs do filepath = File.join(HERE, "examples", "obs", "main.rb") ruby filepath end end