summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/unittest-cpp/docs
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/unittest-cpp/docs')
-rw-r--r--3rdparty/unittest-cpp/docs/Building-Using-CMake.md19
-rw-r--r--3rdparty/unittest-cpp/docs/Home.md20
-rw-r--r--3rdparty/unittest-cpp/docs/Macro-Reference.md73
-rw-r--r--3rdparty/unittest-cpp/docs/Writing-More-Tests-With-the-Bowling-Game-Kata.md105
-rw-r--r--3rdparty/unittest-cpp/docs/Writing-and-Running-Your-First-Test.md65
5 files changed, 0 insertions, 282 deletions
diff --git a/3rdparty/unittest-cpp/docs/Building-Using-CMake.md b/3rdparty/unittest-cpp/docs/Building-Using-CMake.md
deleted file mode 100644
index bd24a0eec6d..00000000000
--- a/3rdparty/unittest-cpp/docs/Building-Using-CMake.md
+++ /dev/null
@@ -1,19 +0,0 @@
-While there are some bundled makefiles and projects, UnitTest++ is primarily built and supported using [CMake](http://cmake.org). This guide assumes you have already downloaded and installed CMake, and that you have already downloaded the UnitTest++ source.
-
-
-In Two Easy Steps
--------------------
-
-Once you've obtained the UnitTest++ source, you can use the empty 'builds' folder as a place to put your cmake-generated project files. The valid "generators" differ per platform; you can run `cmake --help` to see which ones are supported on your platform.
-
- cd path/to/unittest-cpp/builds
- cmake -G "<Choose a valid generator>" ../
- cmake --build ./
-
-This will build the library and the self-tests, and also run the self-tests.
-
-Then, if you already understand what CMake does (or are just reckless), and you'd like to run the install step:
-
- cmake --build ./ --target install
-
-This will install the headers and built libs to the `CMAKE_INSTALL_PREFIX`. Note this might require a `sudo` in *nix or an Administrative Command Prompt on Windows depending on your system configuration.
diff --git a/3rdparty/unittest-cpp/docs/Home.md b/3rdparty/unittest-cpp/docs/Home.md
deleted file mode 100644
index 129d16dcc59..00000000000
--- a/3rdparty/unittest-cpp/docs/Home.md
+++ /dev/null
@@ -1,20 +0,0 @@
-UnitTest++ is a lightweight unit testing framework for C++.
-
-It was designed to do test-driven development on a wide variety of platforms. The primary drivers are four-fold:
-
-* Simplicity
-* Portability
-* Speed (both compilation and runtime)
-* Small footprint
-
-Documentation
--------------
-
-[[Building Using CMake]]
-
-[[Writing and Running Your First Test]]
-
-[[Writing More Tests With the Bowling Game Kata]]
-
-[[Macro Reference]]
-
diff --git a/3rdparty/unittest-cpp/docs/Macro-Reference.md b/3rdparty/unittest-cpp/docs/Macro-Reference.md
deleted file mode 100644
index 25aff04d408..00000000000
--- a/3rdparty/unittest-cpp/docs/Macro-Reference.md
+++ /dev/null
@@ -1,73 +0,0 @@
-Suites
---------
-`SUITE(Name)`: Organizes your tests into suites (groups). Tests can be added to suites across multiple test source files. e.g.:
-
-```cpp
-SUITE(MySuite)
-{
- // tests go here
-}
-```
-
-Tests
--------
-`TEST(Name)`: Creates a single test case. All checks in a test will be run using the standard runners, unless an exception is thrown or an early return is introduced.
-
-```cpp
-TEST(MyTest)
-{
- // checks go here
-}
-```
-
-`TEST_FIXTURE(FixtureClass, TestName)`: Creates a single test case using a fixture. The FixtureClass is default instantiated before the test is run, then the test runs with access to anything `public` or `protected` in the fixture. Useful for sharing setup / teardown code.
-
-```cpp
-class MyFixture
-{
-public:
- MyFixture() { // setup goes here }
- ~MyFixture() { // teardown goes here }
-};
-
-TEST_FIXTURE(MyFixture, MyFixtureTest)
-{
- // checks go here
-}
-```
-
-Checks
---------
-`CHECK(statement)`: Verifies the statement evaluates to true (not necessary boolean true / false).
-
-```cpp
-CHECK(true); // passes
-CHECK(1 == 2); // fails
-CHECK(0); // fails
-```
-
-`CHECK_EQUAL(expected, actual)`: Verifies that the actual value matches the expected. Note that conversions can occur. Requires `operator==` for the types of `expected` and `actual`, and requires the ability for both types to be streamed to `UnitTest::MemoryOutStream` using `operator<<`.
-
-```cpp
-CHECK_EQUAL(1, 1); // passes
-CHECK_EQUAL("123", std::string("123")); //passes
-CHECK_EQUAL((1.0 / 40.0), 0.025000000000000001); // passes... wait what? be careful with floating point types!
-```
-
-`CHECK_CLOSE(expected, actual, tolerance)`: Verifies that the actual value is within +/- tolerance of the expected value. This has the same requirements of the types involved as `CHECK_EQUAL`.
-
-```cpp
-CHECK_CLOSE(0.025000000000000002, (1.0 / 40.0), 0.000000000000000001); // passes
-CHECK_CLOSE(0.025, (1.0 / 40.0), 0.000000000000000001); // also passes
-CHECK_CLOSE(0.025000000000000020, (1.0 / 40.0), 0.000000000000000001); // fails
-```
-
-`CHECK_THROW(expression, ExpectedExceptionType)`: Verifies that the expression throws an exception that is polymorphically of the ExpectedExceptionType.
-
-`CHECK_ARRAY_EQUAL(expected, actual, count)`: Like `CHECK_EQUAL`, but for arrays and containers that support random access (`operator[]`). `count` is the number of items in the array.
-
-`CHECK_ARRAY_CLOSE(expected, actual, count, tolerance)`: Like `CHECK_CLOSE`, but for arrays and containers that support random access (`operator[]`). `count` is the number of items in the array.
-
-`CHECK_ARRAY2D_CLOSE(expected, actual, rows, columns, tolerance)`: Like `CHECK_ARRAY_CLOSE` but for two-dimensional arrays.
-
-
diff --git a/3rdparty/unittest-cpp/docs/Writing-More-Tests-With-the-Bowling-Game-Kata.md b/3rdparty/unittest-cpp/docs/Writing-More-Tests-With-the-Bowling-Game-Kata.md
deleted file mode 100644
index 09aab29a808..00000000000
--- a/3rdparty/unittest-cpp/docs/Writing-More-Tests-With-the-Bowling-Game-Kata.md
+++ /dev/null
@@ -1,105 +0,0 @@
-The Bowling Game Kata refers to a test-driven development practice exercise recommended by Robert C. Martin or, as he is often referred to, Uncle Bob. You can find his version of it here: <http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata>
-
-We will progress through the exercise similarly to the Java version, using UnitTest++. To summarize, our goal is to create a class `Game` that has two methods:
-
-* `roll(pins : int)` which is called each time the ball is rolled; `pins` is the number of pins knocked down.
-* `score() : int` is called at the end of the game, returning the total score.
-
-For simplicity's sake, I will be putting the `Game` class and the test cases in a single file.
-
-The First Test
-----------------
-In our first test, we'll verify that a gutter game (20 gutter balls) scores a total of zero. First we create our Game class and our test suite:
-
-```cpp
-#include "UnitTest++/UnitTest++.h"
-
-class Game
-{
-};
-
-SUITE(BowlingGameTest)
-{
- TEST(GutterGame)
- {
- Game g;
- }
-}
-```
-
-The `SUITE` macro introduces a bundled set of tests. While not strictly required by UnitTest++, suites can be used to annotate and organize your tests, and to selectively run them. The `TEST` macro, as previous introduced, is the actual test case; right now it isn't asserting anything. Let's add the actual test.
-
-```cpp
-SUITE(BowlingGameTest)
-{
- TEST(GutterGame)
- {
- Game g;
-
- for (int i = 0; i < 20; ++i)
- {
- g.roll(0);
- }
-
- CHECK_EQUAL(0, g.score());
- }
-}
-```
-
-This will fail to compile until we add the requisite methods to game, so let's do that:
-
-```cpp
-class Game
-{
-public:
- void roll(int pins)
- {
- }
-
- int score() const
- {
- return -1;
- }
-};
-```
-
-Now we build and run and we have a failure:
-
- TheFirstTest.cpp:27:1: error: Failure in GutterGame: Expected 0 but was -1
- FAILURE: 1 out of 1 tests failed (1 failures).
-
-Now, obviously we know more about our final implementation than this, but for now we can "fake it" to make the build succeed by changing score to return 0. We end up with the full code below:
-
-```cpp
-#include "UnitTest++/UnitTest++.h"
-
-class Game
-{
-public:
- void roll(int pins)
- {
- }
-
- int score() const
- {
- return 0;
- }
-};
-
-SUITE(BowlingGameTest)
-{
- TEST(GutterGame)
- {
- Game g;
-
- for (int i = 0; i < 20; ++i)
- {
- g.roll(0);
- }
-
- CHECK_EQUAL(0, g.score());
- }
-}
-```
-
-The test passes and we're ready to move on to [[Writing More Tests With the Bowling Game Kata: Test Two]].
diff --git a/3rdparty/unittest-cpp/docs/Writing-and-Running-Your-First-Test.md b/3rdparty/unittest-cpp/docs/Writing-and-Running-Your-First-Test.md
deleted file mode 100644
index 42acd8b70f6..00000000000
--- a/3rdparty/unittest-cpp/docs/Writing-and-Running-Your-First-Test.md
+++ /dev/null
@@ -1,65 +0,0 @@
-Let's assume that, whatever compiler / IDE / build system you're using, you know how to include the headers and libraries built in [Building UnitTest++ using CMake](wiki/Building-UnitTest++-With-CMake). There are too many build systems to cover here, and is not the purpose of this guide.
-
-Examples
-
-Creating Your Test Executable Main
-------------------------------------
-
-The most basic main function you can write that will run your unit tests will look something like this:
-
-```cpp
-// main.cpp -- take 1
-#include "UnitTest++/UnitTest++.h"
-
-int main(int, const char *[])
-{
- return UnitTest::RunAllTests();
-}
-```
-
-If this compiles and links, you can now run and you should get output resembling this:
-
-```
-Success: 0 tests passed.
-Test time: 0.00 seconds.
-```
-
-Adding a Sanity Test
-----------------------
-If you ran the self-tests bundled with UnitTest++, we should be pretty comfortable that everything is working okay at this point. However, the next thing I usually like to do is add a "sanity test".
-
-```cpp
-// main.cpp -- take 2
-#include "UnitTest++/UnitTest++.h"
-
-TEST(Sanity)
-{
- CHECK_EQUAL(1, 1);
-}
-
-int main(int, const char *[])
-{
- return UnitTest::RunAllTests();
-}
-```
-
-The `TEST` token is a C-style macro that introduces a test case named 'Sanity'. The `CHECK_EQUAL` token is, similarly, a macro. In this case it is asserting that, for the test to pass, 1 must be equal to 1. Running this test program should output:
-
-```
-Success: 1 tests passed.
-Test time: 0.00 seconds.
-```
-
-If you want to doubly check the sanity of things, we can make our test fail by changing `CHECK_EQUAL(1, 1)` to `CHECK_EQUAL(1, 2)`. Run this and you should now see something like this:
-
-```
-main.cpp:6:1: error: Failure in Sanity: Expected 1 but was 2
-FAILURE: 1 out of 1 tests failed (1 failures).
-Test time: 0.00 seconds.
-```
-
-The exact output will vary somewhat based on your environment. What is perhaps most important, however, is that the OS exit code will be non-zero, indicating a failure to your toolchain. `UnitTest::RunAllTests()` returns the number of failures that occurred during the run.
-
-Next Steps
-------------
-If you're comfortable with the concepts of unit testing in general, you can probably go on now to the [[Macro Reference]] to learn about the CHECK and TEST macros available to you. However, if you'd like a more detailed guide to using UnitTest++, especially in the context of test-driven development, you might want to go on to [[Writing More Tests With the Bowling Game Kata]]. \ No newline at end of file