Skip to content

Commit 6ac6b68

Browse files
committed
Update run-tests section
1 parent 9f61b4c commit 6ac6b68

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

docs/cn/getting_started.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# BUILD
22

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

66
brpc depends on following packages:
77

@@ -23,7 +23,7 @@ $ make
2323
```
2424
to change compiler to clang, add `--cxx=clang++ --cc=clang`.
2525

26-
### run example
26+
### Run example
2727

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

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

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

41-
Rerun config_brpc.sh and run make in test/
41+
```shell
42+
cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/
43+
```
44+
45+
The directory of gtest source code may be changed, try `/usr/src/googletest/googletest` if `/usr/src/gtest` is not there.
46+
47+
Rerun `config_brpc.sh`, `make` in test/, and `sh run_tests.sh`
4248

4349
## Fedora/CentOS
4450

@@ -58,7 +64,7 @@ $ make
5864
```
5965
to change compiler to clang, add `--cxx=clang++ --cc=clang`.
6066

61-
### run example
67+
### Run example
6268

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

71-
To run examples with cpu/heap profilers, install `gperftools-devel` and re-run `config_brpc.sh` before compiling
77+
To run examples with cpu/heap profilers, install `gperftools-devel` and re-run `config_brpc.sh` before compiling.
78+
79+
### Run tests
80+
81+
Install gtest-devel.
82+
83+
Rerun `config_brpc.sh`, `make` in test/, and `sh run_tests.sh`
7284

7385
## Linux with self-built deps
7486

@@ -125,7 +137,7 @@ no known issues.
125137

126138
## protobuf: 2.4-3.2
127139

128-
Be compatible with pb 3.0 and pb 2.x with the same file:
140+
Be compatible with pb 3.0 and pb 2.x with the same file:
129141
Don't use new types in proto3 and start the proto file with `syntax="proto2";`
130142
[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.
131143
protobuf 3.3-3.4 is not tested yet.

0 commit comments

Comments
 (0)