Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 1 | require "rake/testtask" |
| 2 | |
| 3 | # Proto for tests. |
| 4 | genproto_output = [] |
| 5 | genproto_output << "tests/generated_code.rb" |
| 6 | genproto_output << "tests/test_import.rb" |
| 7 | file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task| |
| 8 | sh "./protoc --ruby_out=. tests/generated_code.proto" |
| 9 | end |
| 10 | |
| 11 | file "tests/test_import.rb" => "tests/test_import.proto" do |file_task| |
| 12 | sh "./protoc --ruby_out=. tests/test_import.proto" |
| 13 | end |
| 14 | |
| 15 | task :genproto => genproto_output |
| 16 | |
| 17 | task :clean do |
| 18 | sh "rm -f #{genproto_output.join(' ')}" |
| 19 | end |
| 20 | |
| 21 | Rake::TestTask.new(:test => :genproto) do |t| |
| 22 | t.test_files = FileList["tests/*.rb"] |
| 23 | end |
| 24 | |
| 25 | task :default => [:test] |