You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,17 @@ layout: default
3
3
profile: true
4
4
---
5
5
6
-
C++Spec is a behavior-driven development library for C++ with an RSpec-inspired DSL. Designed with ease of use and rapid prototyping in mind, C++Spec offers an alternative to traditional testing libraries and frameworks. Some of the core concepts:
6
+
C++Spec is a behavior-driven development library for C++ with an RSpec-inspired DSL. Designed with ease of use and rapid prototyping in mind, C++Spec offers an alternative to traditional testing libraries and frameworks. Some things that make C++Spec different than other testing libraries:
7
7
8
8
- A clean, readable syntax
9
9
- As few macros as possibles
10
10
- Use as a library, not a framework
11
11
- Easily extensible with custom matchers.
12
12
- Support for the RSpec and Jasmine constructs you'd expect, such as describe, context, it, expect, and let.
13
13
- Can automatically generate documentation strings based on your tests
14
+
- Cross-platform with no need to change complex build settings.
15
+
16
+
14
17
15
18
## An example:
16
19
@@ -42,17 +45,17 @@ int_list_spec("A list of ints", {1,2,3}, $ {
42
45
43
46
## Usage:
44
47
45
-
Download the [header file]() and put it in your project either alongside your tests or in a folder that is in your `INCLUDE` path. Then, simply `#include "cppspec.hpp"` and you're ready to go.
48
+
Download the [header file]() and put it in your project either alongside your tests or in a folder that is in your `INCLUDE` path. Then, simply `#include "cppspec.hpp"` and you're ready to go. Both user and API documentation is available at the top of this page, and a tutorial will soon be available.
46
49
47
50
## How does it work?
48
51
49
52
C++Spec utilizes templated classes and functions as well as C++14 features in order to automatically deduce the types of your objects and construct your tests.
50
53
51
54
Lambdas are passed to functions (such as `context` and `it`) in order to build an execution tree at runtime. A formatter object visits each node when the tests are run and prints the status of the tests and any errors.
52
55
53
-
## I'm getting really long errors. What's going on?
56
+
## I'm getting really long compiler errors. What's going on?
54
57
55
-
Due to how the library is constructed with both templates and auto-typelambdas, error messages from the compiler can be difficult to understand. Errors also tend to cascade and make the enclosing objects also fail, further obfuscating what's actually going wrong.
58
+
Due to how the library is constructed with both templates and type-deduced (auto) lambdas, error messages from the compiler can be difficult to understand. Errors also tend to cascade and make the structures above the problem code also fail to compile, further obfuscating what's actually going wrong.
56
59
57
60
Usually, the only information you want is the actual error, not all of the template substitution notes. You can reduce the template backtrace by using the flag `-ftemplate-backtrace-limit=1` when compiling with GCC and Clang.
0 commit comments