Adding detailed documentation on how to run conformance tests with bazel (#10469)

* Adding detailed documentation on how to run conformance tests with bazel

* Fix C# instructions

* Fixing formatting of command snippets

* More formatting fixes

* Capitalization
pull/10476/head
Mike Kruskal 3 years ago committed by GitHub
parent ad42a9761a
commit 66ed6dd75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 43
      conformance/README.md

@ -40,15 +40,50 @@ tests using similar patterns. You can either use Bazel to run the
or create an executable for a custom test and pass it to or create an executable for a custom test and pass it to
`conformance_test_runner`. `conformance_test_runner`.
For example, to run the Ruby tests against MRI, you can call:
$ bazel test //ruby:conformance_test
Note: CMake can be used to build the conformance test runner, but not any of Note: CMake can be used to build the conformance test runner, but not any of
the conformance test executables outside C++. So if you aren't using Bazel the conformance test executables outside C++. So if you aren't using Bazel
you'll need to create the executable you pass to `conformance_test_runner` via you'll need to create the executable you pass to `conformance_test_runner` via
some alternate build system. some alternate build system.
While we plan to model all our supported languages more completely in Bazel,
today some of them are a bit tricky to run. Below is a list of the commands
(and prerequisites) to run each language's conformance tests.
Java:
$ bazel test //java/core:conformance_test //java/lite:conformance_test
Python:
$ bazel test //python:conformance_test
Python C++:
$ bazel test //python:conformance_test_cpp --define=use_fast_cpp_protos=true
C#:
$ `which dotnet || echo "You must have dotnet installed!"
$ `bazel test //csharp:conformance_test \
--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=~ \
--action_env=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
Objective-c (Mac only):
$ `bazel test //objectivec:conformance_test --macos_minimum_os=10.9
Ruby:
$ [[ $(ruby --version) == "ruby"* ]] || echo "Select a C Ruby!"
$ bazel test //ruby:conformance_test --define=ruby_platform=c \
--action_env=PATH --action_env=GEM_PATH --action_env=GEM_HOME
JRuby:
$ [[ $(ruby --version) == "jruby"* ]] || echo "Switch to Java Ruby!"
$ bazel test //ruby:conformance_test --define=ruby_platform=java \
--action_env=PATH --action_env=GEM_PATH --action_env=GEM_HOME
Testing other Protocol Buffer implementations Testing other Protocol Buffer implementations
--------------------------------------------- ---------------------------------------------

Loading…
Cancel
Save