1ffe3c632Sopenharmony_cirequire "rake/testtask" 2ffe3c632Sopenharmony_ci 3ffe3c632Sopenharmony_ci# Proto for tests. 4ffe3c632Sopenharmony_cigenproto_output = [] 5ffe3c632Sopenharmony_cigenproto_output << "tests/generated_code.rb" 6ffe3c632Sopenharmony_cigenproto_output << "tests/test_import.rb" 7ffe3c632Sopenharmony_cifile "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task| 8ffe3c632Sopenharmony_ci sh "./protoc --ruby_out=. tests/generated_code.proto" 9ffe3c632Sopenharmony_ciend 10ffe3c632Sopenharmony_ci 11ffe3c632Sopenharmony_cifile "tests/test_import.rb" => "tests/test_import.proto" do |file_task| 12ffe3c632Sopenharmony_ci sh "./protoc --ruby_out=. tests/test_import.proto" 13ffe3c632Sopenharmony_ciend 14ffe3c632Sopenharmony_ci 15ffe3c632Sopenharmony_citask :genproto => genproto_output 16ffe3c632Sopenharmony_ci 17ffe3c632Sopenharmony_citask :clean do 18ffe3c632Sopenharmony_ci sh "rm -f #{genproto_output.join(' ')}" 19ffe3c632Sopenharmony_ciend 20ffe3c632Sopenharmony_ci 21ffe3c632Sopenharmony_ciRake::TestTask.new(:test => :genproto) do |t| 22ffe3c632Sopenharmony_ci t.test_files = FileList["tests/*.rb"] 23ffe3c632Sopenharmony_ciend 24ffe3c632Sopenharmony_ci 25ffe3c632Sopenharmony_citask :default => [:test] 26