Skip to content

Commit

Permalink
Add information on unit tests requirements and cmake based build.
Browse files Browse the repository at this point in the history
  • Loading branch information
vahancho committed Jul 15, 2020
1 parent 83ff6b8 commit 620a285
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ No installation required. Just compile *polylineencoder.h(.cpp)* in your project

## Prerequisites

No special requirements except *C++11* compliant compiler. The class is tested with *gcc 4.8.4* and *MSVC 12.0* (Visual Studio 2013).
No special requirements except *C++11* compliant compiler. The class is tested with *gcc 4.8.4* and *MSVC 12.0* (Visual Studio 2013). In order to build and run unit tests for this project you are required to have Google Test library installed on the system.
For more details see the CI badges (*Travis CI & AppVeyor CI*).

## Usage Example:
Expand All @@ -39,11 +39,10 @@ for (const auto &point : polyline) {
}
```

## Test
## Building and Testing

There are unit tests provided for `PolylineEncoder` class. You can find them in the *test/* directory.
To run them you have to build and run the test application. For doing that you must invoke the following
commands from the terminal, assuming that compiler and environment are already configured:
To run them you have to build and run the test application (linking with Google Test library is required). For doing that you can invoke the following commands from the terminal, assuming that compiler and environment are already configured:

##### Linux (gcc)
```
Expand All @@ -52,13 +51,31 @@ g++ -std=c++11 main.cpp -o test
./test
```

or with CMake

```
cd test
cmake ..
make
./poly_test
```

##### Windows
```
cd test
cl /W4 /EHsc main.cpp /link /out:test.exe
test
```

or with CMake

```
cd test
cmake .. -G "NMake Makefiles"
nmake
poly_test
```

## See Also

* [Encoded Polyline Algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
Expand Down

0 comments on commit 620a285

Please sign in to comment.