Lines Matching +full:protocol +full:- +full:tests
6 and optionally [Git](http://git-scm.com) installed on your computer before proceeding.
39 Optionally, you will want to download [ninja](https://ninja-build.org/) and add it to your *PATH* v…
52 For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if
53 you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package
55 download `protobuf-all-[VERSION].tar.gz`.
60 C:\Path\to\src> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git
62 Where *[release_tag]* is a git tag like *v3.0.0-beta-1* or a branch name like *main*
74 C:\Path\to\src\protobuf> git submodule update --init --recursive
83 [generators](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
88 * [Makefile](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#makefile-generat…
91 … Studio](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-gener…
94 * [Ninja](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#ninja-generator)
95 …This uses the external tool [Ninja](https://ninja-build.org/) to build. It is the fastest solution…
98 …support for opening directly CMake-based projects](https://docs.microsoft.com/en-us/cpp/build/cmak…
114 C:\Path\to\build\protobuf\release>cmake -G "NMake Makefiles" ^
115 -DCMAKE_BUILD_TYPE=Release ^
116 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
124 C:\Path\to\build\protobuf\debug>cmake -G "Ninja" ^
125 -DCMAKE_BUILD_TYPE=Debug ^
126 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
131 The *Visual Studio* generator is multi-configuration: it will generate a single *.sln* file that ca…
134 C:\Path\to\build\protobuf\solution>cmake -G "Visual Studio 16 2019" ^
135 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
140 Unit Tests
141 ----------
143 Unit tests are being built along with the rest of protobuf. The unit tests require Google Mock (now…
145 …//github.com/google/googletest) is included as a Git submodule in the `third-party/googletest` fol…
148 Alternately, you may want to use protobuf in a larger set-up, you may want to use that standard CMa…
152 during the configuration step: `-Dprotobuf_USE_EXTERNAL_GTEST=ON`.
164 C:\Path\to\build\protobuf\solution>cmake -G "Visual Studio 16 2019" ^
165 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
166 -DCMAKE_PREFIX_PATH=C:\Path\to\my_big_project ^
167 -Dprotobuf_USE_EXTERNAL_GTEST=ON ^
172 …etely, you need to add the following argument to you *cmake* command line: `-Dprotobuf_BUILD_TESTS…
176 C:\Path\to\build\protobuf\solution>cmake -G "Visual Studio 16 2019" ^
177 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
178 -Dprotobuf_BUILD_TESTS=OFF ^
184 The standard way to compile a *CMake* project is `cmake --build <directory>`.
189 cmake --build C:\Path\to\build\protobuf\solution --config Release
212 To run unit-tests, first you must compile protobuf as described above.
215 C:\Path\to\protobuf\cmake\build\release>ctest --progress --output-on-failure
219 C:\Path\to\protobuf\cmake\build\release>cmake --build . --target check
231 [==========] Running 1546 tests from 165 test cases.
235 [==========] 1546 tests from 165 test cases ran. (2529 ms total)
236 [ PASSED ] 1546 tests.
238 To run specific tests, you need to pass some command line arguments to the test program itself:
240 C:\Path\to\build\protobuf\release>tests.exe --gtest_filter=AnyTest*
243 [==========] Running 3 tests from 1 test case.
244 [----------] Global test environment set-up.
245 [----------] 3 tests from AnyTest
252 [----------] 3 tests from AnyTest (1 ms total)
254 [----------] Global test environment tear-down
255 [==========] 3 tests from 1 test case ran. (2 ms total)
256 [ PASSED ] 3 tests.
258 Note that the tests must be run from the source folder.
260 If all tests are passed, safely continue.
267 cmake --build C:\Path\to\build\protobuf\solution --config Release --target install
281 * bin - that contains protobuf *protoc.exe* compiler;
282 * include - that contains C++ headers and protobuf *.proto files;
283 * lib - that contains linking libraries and *CMake* configuration files for *protobuf* package.
288 …* Copy linking libraries libprotobuf[d].lib, libprotobuf-lite[d].lib, and libprotoc[d].lib whereve…
298 Static linking is now the default for the Protocol Buffer libraries. Due to
305 * Add an additional flag `-Dprotobuf_BUILD_SHARED_LIBS=ON` when invoking cmake
314 libraries will *not* be usable as drop-in replacements.
316 If your project is itself a DLL intended for use by third-party software, we
317 recommend that you do NOT expose protocol buffer objects in your library's
318 public interface, and that you statically link protocol buffers into your
328 Obtain a copy of the zlib library. The pre-compiled DLL at zlib.net works.
339 C:\Path\to\src>git clone -b v1.2.8 https://github.com/madler/zlib.git
346 C:\Path\to\build\zlib\release>cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ^
347 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install C:\Path\to\src\zlib
348 C:\Path\to\src\zlib\build\release>cmake --build . --target install
357 You need reconfigure protobuf with flag `-Dprotobuf_WITH_ZLIB=ON` when invoking cmake.
360 further disable the option `-Dprotobuf_MSVC_STATIC_RUNTIME=OFF`.
367 -DZLIB_INCLUDE_DIR=<path to dir containing zlib headers>
368 -DZLIB_LIB=<path to dir containing zlib>
379 * C4244 - Conversion from 'type1' to 'type2', possible loss of data.
380 * C4251 - 'identifier' : class 'type' needs to have dll-interface to be used by
382 * C4267 - Conversion from 'size_t' to 'type', possible loss of data.
383 * C4305 - 'identifier' : truncation from 'type1' to 'type2'
384 * C4355 - 'this' : used in base member initializer list
385 * C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
386 * C4996 - 'function': was declared deprecated
388 C4251 is of particular note, if you are compiling the Protocol Buffer library
389 as a DLL (see previous section). The protocol buffer library uses templates in
395 Protocol Buffer implementation does not rely on static template members being
398 produced when compiling code which merely uses protocol buffers, meaning you