Skip to content

Commit 563031f

Browse files
committed
📚 [README] Quick start
1 parent d2d7b06 commit 563031f

File tree

1 file changed

+86
-56
lines changed

1 file changed

+86
-56
lines changed

README.md

+86-56
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
---
77

8-
## Testing
8+
### Testing
99

1010
> "If you liked it then you should have put a test on it", Beyonce rule
1111
@@ -14,9 +14,18 @@
1414
1515
* Improve your productivity with GUnit, a library which extends/simplifies [Google.Test/Google.Mock](https://github.com/google/googletest) and adds support for [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) (Behaviour Driven Development) to it.
1616

17-
## Motivation
17+
* Why it's based on [Google.Test/Google.Mock](https://github.com/google/googletest)?
18+
* (+) Google.Test is **widely used** (The most popular testing framework according to https://www.jetbrains.com/research/devecosystem-2017/cpp)
19+
* (+) Google.Test is **stable**
20+
* (+) Google.Test is **powerful**
21+
* (+) Google.Test comes with **Google.Mock**
22+
* (+) Google.Test is **well documented**
23+
* (-) Google.Test **doesn't have support for - [gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) style - tests**
24+
* (-) Google.Test and Google.Mock have a lot **boilerplate macros**
1825

19-
> ### No more base classes and labels as identifiers - [GUnit.GTest](docs/GTest.md) / [GUnit.GTest-Lite](docs/GTest-Lite.md)
26+
### Motivation Examples
27+
28+
> #### No more base classes and labels as identifiers - [GUnit.GTest](docs/GTest.md) / [GUnit.GTest-Lite](docs/GTest-Lite.md)
2029
```cpp
2130
Google.Test | GUnit.GTest
2231
--------------------------------------------------+------------------------------------------------------
@@ -51,7 +60,7 @@
5160
[----------] 2 tests from CalcTest (1 ms total) | [----------] 1 tests from Example (0 ms total)
5261
```
5362

54-
> ### No more hand written mocks - [GUnit.GMock](docs/GMock.md)
63+
> #### No more hand written mocks - [GUnit.GMock](docs/GMock.md)
5564
```cpp
5665
struct interface {
5766
virtual ~interface() = default;
@@ -80,7 +89,7 @@
8089
} | }
8190
```
8291

83-
> ### Simplified creation and injection of SUT (System Under Test) and mocks - [GUnit.GMake](docs/GMake.md)
92+
> #### Simplified creation and injection of SUT (System Under Test) and mocks - [GUnit.GMake](docs/GMake.md)
8493
```cpp
8594
class coffee_maker {
8695
public:
@@ -109,7 +118,7 @@
109118
}
110119
```
111120

112-
> ### Support for - [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) style - BDD (Behaviour Driven Development) scenarios - [GUnit.GSteps](docs/GSteps.md)
121+
> #### Support for - [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) style - BDD (Behaviour Driven Development) scenarios - [GUnit.GSteps](docs/GSteps.md)
113122

114123
> Feature specification
115124

@@ -178,65 +187,86 @@
178187
[ PASSED ] 1 tests.
179188
```
180189
181-
## Overview
182-
* Extensions (independent)
183-
* `GUnit.GTest` - Google.Test with strings and more friendly macros
184-
* Test cases with string as names
185-
* No more SetUp/TearDown (SHOULD clauses)
186-
* One (GTEST) macro for all types of tests
187-
* 100% Compatible with tests using GTest
188-
* `GUnit.GTest-Lite` - lightweight, limited, no-macro way of defining simple tests
189-
* `GUnit.GMock` - Google.Mock without hand written mocks
190-
* No more hand written mocks!
191-
* Support for more than 10 parameters
192-
* Quicker compilation times
193-
* Support for unique_ptr without any tricks
194-
* Support for overloaded operators
195-
* Support for mocking classes with constructors
196-
* 100% Compatible with Google Mocks
197-
* `GUnit.GMake` - Makes creation of System Under Test (SUT) and Mocks easier
198-
* No need to instantiate SUT (System Under Test) and mocks
199-
* Automatic mocks injection
200-
* `GUnit.GSteps` - Behaviour Driven Development
201-
* Support for - [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) style - BDD tests
202-
* Based on top of [Google.Test/Google.Mock](https://github.com/google/googletest)
203-
* (+) Widely used (The most popular testing framework according to https://www.jetbrains.com/research/devecosystem-2017/cpp)
204-
* (+) Stable
205-
* (+) Powerful
206-
* (+) Comes with GoogleMock
207-
* (+) Well documented
208-
* (-) No support for - [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) style - BDD tests
209-
* (-) Boilerplate macros
210-
* Requirements
190+
### Overview
191+
192+
* `GUnit.GTest` - Google.Test with strings and more friendly macros
193+
* Test cases with string as names
194+
* No more SetUp/TearDown (SHOULD clauses)
195+
* One (GTEST) macro for all types of tests
196+
* 100% Compatible with tests using GTest
197+
* `GUnit.GTest-Lite` - lightweight, limited, no-macro way of defining simple tests
198+
* `GUnit.GMock` - Google.Mock without hand written mocks
199+
* No more hand written mocks!
200+
* Support for more than 10 parameters
201+
* Quicker compilation times
202+
* Support for unique_ptr without any tricks
203+
* Support for overloaded operators
204+
* Support for mocking classes with constructors
205+
* 100% Compatible with Google Mocks
206+
* `GUnit.GMake` - Makes creation of System Under Test (SUT) and Mocks easier
207+
* No need to instantiate SUT (System Under Test) and mocks
208+
* Automatic mocks injection
209+
* `GUnit.GSteps` - Behaviour Driven Development
210+
* Support for - [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) style - BDD tests
211+
212+
### Quick Start
213+
214+
* If your project is **NOT** using [Google.Test/Google.Mock](https://github.com/google/googletest)
215+
* Follow instructions from https://github.com/google/googletest/tree/master/googletest
216+
* Clone the repository
217+
* `git clone https://github.com/cpp-testing/GUnit.git`
218+
* Add `GUnit/include` directory to your include path
219+
* `-I GUnit/include`
220+
* Write some tests...
221+
* Compile and Run!
222+
223+
---
224+
225+
* [**Optional**] For [gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) support
226+
* Compile `gherkin-cpp`
227+
```sh
228+
$cd libs/gherkin-cpp && make lib
229+
$ls libs/gherkin-cpp
230+
libgherkin-cpp.a
231+
libgherkin-cpp.so
232+
```
233+
* Add include paths
234+
* `-I GUnit/gherkin-cpp/include`
235+
* `-I GUnit/json/src`
236+
* Link with `libgherkin-cpp.{a, so}`
237+
* `-L libgherkin-cpp`
238+
* Write some feature tests...
239+
* Compile and Run!
240+
241+
---
242+
243+
* To run GUnit tests/benchmarks
244+
```sh
245+
$mkdir build && cd build && cmake ..
246+
$make && ctest
247+
```
248+
249+
### Requirements
211250
* [C++14](https://ubershmekel.github.io/cppdrafts/c++14-cd.html)
212251
* `GTest/GTest-Lite/GMock/GMake`
213252
* [libs/googletest](https://github.com/google/googletest) - compatible with all versions
214253
* `GSteps`
215254
* [libs/json](https://github.com/nlohmann/json)
216255
* [libs/gherkin-cpp](https://github.com/c-libs/gherkin-cpp)
217-
* Building libgherkin-cpp
218-
```
219-
$cd libs/gherkin-cpp && make lib
220-
$ls libs/gherkin-cpp
221-
libgherkin-cpp.a
222-
libgherkin-cpp.so
223-
```
224-
* Tested compilers
256+
257+
### Tested compilers
225258
* [Linux - GCC-5+](https://travis-ci.org/cpp-testing/GUnit)
226259
* [Linux - Clang-3.7+](https://travis-ci.org/cpp-testing/GUnit)
227260
* [Mac OSx - Xcode-7.3+](https://travis-ci.org/cpp-testing/GUnit)
228-
* Quick start
229-
```sh
230-
$mkdir build && cd build && cmake ..
231-
$make && ctest
232-
```
233-
* User Guide
234-
* [GUnit.GTest](docs/GTest.md)
235-
* [GUnit.GTest-Lite](docs/GTest-Lite.md)
236-
* [GUnit.GMock](docs/GMock.md)
237-
* [GUnit.GMake](docs/GMake.md)
238-
* [GUnit.GSteps](docs/GSteps.md)
239-
* [FAQ](docs/FAQ.md)
261+
262+
### User Guide
263+
* **[GUnit.GTest](docs/GTest.md)**
264+
* **[GUnit.GTest-Lite](docs/GTest-Lite.md)**
265+
* **[GUnit.GMock](docs/GMock.md)**
266+
* **[GUnit.GMake](docs/GMake.md)**
267+
* **[GUnit.GSteps](docs/GSteps.md)**
268+
269+
### [FAQ](docs/FAQ.md)
240270
* [C++ Now 2017: Towards Painless Testing](https://www.youtube.com/watch?v=NVrZjT5lW5o)
241271
242272
### Acknowledgements

0 commit comments

Comments
 (0)