Skip to content

Commit b857570

Browse files
committed
Merge pull request #19 from arstrube/index
Change for cpputest_build/
2 parents 264fe98 + f0204c2 commit b857570

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

index.markdown

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ CppUTest's core design principles are:
2121

2222
There is an Debian and Ubuntu package available for CppUTest. This is by far the easiest way to install it, via:
2323

24-
{% highlight bash %}
24+
```bash
2525
$ apt-get install cpputest
26-
{% endhighlight %}
26+
```
2727

2828
*MacOSX*
2929

3030
For Mac, a Homebrew package is available too. You can install via:
3131

32-
{% highlight bash %}
32+
```bash
3333
$ brew install cpputest
34-
{% endhighlight %}
34+
```
3535

3636
### From source
3737

@@ -42,34 +42,34 @@ This version is automatically packages after a build has passed.
4242

4343
Alternatively, you can clone the github repository, read-only:
4444

45-
{% highlight bash %}
45+
```bash
4646
$ git clone git://github.com/cpputest/cpputest.git
47-
{% endhighlight %}
47+
```
4848

4949
Or clone it via ssh (which requires a github account)
5050

51-
{% highlight bash %}
51+
```bash
5252
$ git clone git@github.com:cpputest/cpputest.git
53-
{% endhighlight %}
53+
```
5454

5555
After you cloned CppUTest, you can build it with your favorite build tool (CMake or autoconf).
5656

5757
Building with autoconf requires you to (this requires you to have installed GNU autotools, apt-get/brew install automake autoconf libtool):
5858

59-
{% highlight bash %}
60-
$ autoreconf -i
61-
$ mkdir build_dir; cd build_dir
62-
$ configure ..
59+
```bash
60+
$ cd cpputest_build
61+
$ autoreconf .. -i
62+
$ ../configure
6363
$ make
64-
{% endhighlight %}
64+
```
6565

6666
Or you can use CMake if that is the build tool you fancy (this requires you have install CMake, apt-get install cmake):
6767

68-
{% highlight bash %}
69-
$ mkdir build_dir; cd build_dir
68+
```bash
69+
$ cd cpputest_build
7070
$ cmake ..
7171
$ make
72-
{% endhighlight %}
72+
```
7373

7474
For Windows users, the above work with cygwin. There are also several MS VC++ projects available.
7575

@@ -84,7 +84,7 @@ For Windows users, the above work with cygwin. There are also several MS VC++ pr
8484

8585
To write your first test, all you need is a new cpp file with a TEST_GROUP and a TEST, like:
8686

87-
{% highlight c++ %}
87+
```c++
8888
TEST_GROUP(FirstTestGroup)
8989
{
9090
};
@@ -93,35 +93,41 @@ TEST(FirstTestGroup, FirstTest)
9393
{
9494
FAIL("Fail me!");
9595
}
96-
{% endhighlight %}
96+
```
9797
9898
This test will fail.
9999
100100
You can add new tests to the test group by just writing more tests in the file, like this:
101101
102-
{% highlight c++ %}
102+
```c++
103103
TEST(FirstTestGroup, SecondTest)
104104
{
105105
STRCMP_EQUAL("hello", "world");
106106
LONGS_EQUAL(1, 2);
107107
CHECK(false);
108108
}
109-
{% endhighlight %}
109+
```
110110

111111
You do need to create a main where you run all the unit tests. Such a main will look like this:
112112

113-
{% highlight c++ %}
113+
```c++
114114
int main(int ac, char** av)
115115
{
116116
return CommandLineTestRunner::RunAllTests(ac, av);
117117
}
118-
{% endhighlight %}
118+
```
119119
120120
For more information, We'd recommend to [read the manual](http://www.cpputest.org) or, even better, check some [existing tests](https://github.com/cpputest/cpputest/tree/master/tests) such as [SimpleStringTest](https://github.com/cpputest/cpputest/blob/master/tests/SimpleStringTest.cpp) or (a bit more complicated) [MemoryLeakDetectorTest](https://github.com/cpputest/cpputest/blob/master/tests/MemoryLeakDetectorTest.cpp) or the [mocking tests](https://github.com/cpputest/cpputest/blob/master/tests/CppUTestExt/TestMockSupport.cpp) or just check out the [Cheat Sheet](https://github.com/cpputest/cpputest/blob/master/tests/CheatSheetTest.cpp)
121121
122122
## Related projects
123123
124-
* For Eclipse users, check out the [CppUTest Eclipse Plugin Project](https://github.com/cpputest/CppUTestEclipsePlugin)
124+
For Eclipse users, also check:
125+
* [CppUTest Eclipse Test Runner](https://github.com/tcmak/CppUTestEclipseJunoTestRunner) This will allow you to run your tests JUnit style with red and green bars, and rerun arbitrary selections of tests.
126+
Prerequisites:
127+
- CppUTest off master
128+
- Eclipse Juno, Kepler, or later
129+
- Eclipse C/C++ Unit Plugin (if not already present in your version of Eclipse; install directly from Eclipse Help -> Install New Software...).
130+
* [CppUTest Eclipse Plugin Project](https://github.com/cpputest/CppUTestEclipsePlugin)
125131
126132
## Authors and Contributors
127133

0 commit comments

Comments
 (0)