Skip to content

Commit 9118ad6

Browse files
committed
Add Ruby compatibilty test against 3.0.0.
1 parent 963473b commit 9118ad6

11 files changed

+2009
-1
lines changed

Makefile.am

+9
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,15 @@ ruby_EXTRA_DIST= \
775775
ruby/.gitignore \
776776
ruby/README.md \
777777
ruby/Rakefile \
778+
ruby/compatibility_tests/v3.0.0/tests/test_import.proto \
779+
ruby/compatibility_tests/v3.0.0/tests/stress.rb \
780+
ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb \
781+
ruby/compatibility_tests/v3.0.0/tests/generated_code_test.rb \
782+
ruby/compatibility_tests/v3.0.0/tests/generated_code.proto \
783+
ruby/compatibility_tests/v3.0.0/tests/basic.rb \
784+
ruby/compatibility_tests/v3.0.0/test.sh \
785+
ruby/compatibility_tests/v3.0.0/Rakefile \
786+
ruby/compatibility_tests/v3.0.0/README.md \
778787
ruby/ext/google/protobuf_c/defs.c \
779788
ruby/ext/google/protobuf_c/encode_decode.c \
780789
ruby/ext/google/protobuf_c/extconf.rb \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Protobuf Ruby Compatibility Tests
2+
3+
This drectory contains a snapshot of protobuf ruby 3.0.0 unittest code and
4+
test scripts used to verifies whether the latest version of protobuf is
5+
still compatible with 3.0.0 generated code.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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]
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
# Change to the script's directory
6+
cd $(dirname $0)
7+
8+
# Download 3.0.0 version of protoc
9+
PROTOC_BINARY_NAME="protoc-3.0.0-linux-x86_64.exe"
10+
if [ `uname` = "Darwin" ]; then
11+
PROTOC_BINARY_NAME="protoc-3.0.0-osx-x86_64.exe"
12+
fi
13+
wget http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0/${PROTOC_BINARY_NAME} -O protoc
14+
chmod +x protoc
15+
16+
# Run tests
17+
rake test

0 commit comments

Comments
 (0)