Skip to content

Commit

Permalink
Update run-tests section
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesge committed Sep 19, 2017
1 parent 9f61b4c commit 6ac6b68
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions docs/cn/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BUILD

brpc prefers static linking if possible, so that deps don't have to be installed on every
machine running the code.
machine running the code.

brpc depends on following packages:

Expand All @@ -23,7 +23,7 @@ $ make
```
to change compiler to clang, add `--cxx=clang++ --cc=clang`.

### run example
### Run example

```
$ cd example/echo_c++
Expand All @@ -33,12 +33,18 @@ $ ./echo_client
```
Examples link brpc statically, if you need to link the shared version, `make clean` and `LINK_SO=1 make`

To run examples with cpu/heap profilers, install `libgoogle-perftools-dev` and re-run `config_brpc.sh` before compiling
To run examples with cpu/heap profilers, install `libgoogle-perftools-dev` and re-run `config_brpc.sh` before compiling.

### compile tests
Install libgtest-dev
### Run tests
Install libgtest-dev (which is not compiled yet) and run:

Rerun config_brpc.sh and run make in test/
```shell
cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/
```

The directory of gtest source code may be changed, try `/usr/src/googletest/googletest` if `/usr/src/gtest` is not there.

Rerun `config_brpc.sh`, `make` in test/, and `sh run_tests.sh`

## Fedora/CentOS

Expand All @@ -58,7 +64,7 @@ $ make
```
to change compiler to clang, add `--cxx=clang++ --cc=clang`.

### run example
### Run example

```
$ cd example/echo_c++
Expand All @@ -68,7 +74,13 @@ $ ./echo_client
```
Examples link brpc statically, if you need to link the shared version, `make clean` and `LINK_SO=1 make`

To run examples with cpu/heap profilers, install `gperftools-devel` and re-run `config_brpc.sh` before compiling
To run examples with cpu/heap profilers, install `gperftools-devel` and re-run `config_brpc.sh` before compiling.

### Run tests

Install gtest-devel.

Rerun `config_brpc.sh`, `make` in test/, and `sh run_tests.sh`

## Linux with self-built deps

Expand Down Expand Up @@ -125,7 +137,7 @@ no known issues.

## protobuf: 2.4-3.2

Be compatible with pb 3.0 and pb 2.x with the same file:
Be compatible with pb 3.0 and pb 2.x with the same file:
Don't use new types in proto3 and start the proto file with `syntax="proto2";`
[tools/add_syntax_equal_proto2_to_all.sh](https://github.com/brpc/brpc/blob/master/tools/add_syntax_equal_proto2_to_all.sh)can add `syntax="proto2"` to all proto files without it.
protobuf 3.3-3.4 is not tested yet.
Expand Down

0 comments on commit 6ac6b68

Please sign in to comment.