From 66ed6dd75b0b5f0d62a9bf90509638f380cbcd7f Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Fri, 26 Aug 2022 18:24:20 -0700 Subject: [PATCH] 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 --- conformance/README.md | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/conformance/README.md b/conformance/README.md index 4928325631..2f62f0ff90 100644 --- a/conformance/README.md +++ b/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 `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 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 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 ---------------------------------------------