Commits

Matt Oswald  committed eacb45f

updated homepage

  • Participants
  • Parent commits 51302c8

Comments (0)

Files changed (1)

 = xUnit++ =
-xUnit++ is a unit testing platform for C++ inspired by [[http://xunit.codeplex.com|xUnit.Net]].
+xUnit++ is a unit testing platform for C++ inspired by [[http://xunit.codeplex.com|xUnit.net]]. It is written entirely in C++11-conformant code, and should be portable to any platform that is minimally compliant with the standard (where minimally compliant means "what Visual Studio 2012 supported at RTM").
 
-== About ==
-xUnit++ borrows heavily from xUnit.net, which means it has the same strengths. It is built to support Test Driven Development, with a goal of being as simple and flexible as possible, without sacrificing features found in modern unit testing platforms. It is compatible with Visual Studio 2012 (and includes integration with the IDE's test explorer window) and gcc (tested on Ubuntu Linux).
+//For status updates, follow me on Twitter: @xunitpp, @moswald.//
 
-=== Quick Start ===
+==== Documentation ====
+[[InstallAndSetup.wiki|//Installation and Setup//]]
+[[Compare.wiki|//How does xUnit++ compare to ...?//]]
+
+== About xUnit++ ==
+xUnit++ borrows heavily from xUnit.net, which means it has the same strengths. It is built to support Test Driven Development, with a goal of being as simple and flexible as possible without sacrificing features found in modern unit testing platforms written for other languages (such as C#). It is compatible with Visual Studio 2012 (and includes integration with the IDE's test explorer window) and gcc (tested on Ubuntu Linux).
+
+=== Quick Look ===
 Let's look at a simple example:
 {{{
 #!c++
-#include "xUnit++.h"
+#include "xUnit/xUnit++.h"
 
 int Double(int x)
 {
-   return x * 2;
+   return x * x;
 }
 
 FACT(DoublingTwoReturnsFour)
 
 {{{
 #!c++
-#include "xUnit++.h"
+#include "xUnit++/xUnit++.h"
 
 int Double(int x)
 {
    return x * x;
 }
 
-THEORY_PROVIDER(DoubleTestData, int, int)
-   THEORY_DATA(2, 1)
-   THEORY_DATA(4, 2)
-   THEORY_DATA(-2, -1)
-   THEORY_DATA(0, 0)
-THEORY_PROVIDER_END
 
-THEORY(DoubleTest, (int expected, int value), DoubleTestData)
+THEORY(DoubleTest, (int expected, int value),
+   std::make_tuple(2, 1),
+   std::make_tuple(4, 2),
+   std::make_tuple(-2, -1),
+   std::make_tuple(0, 0)
+)
 {
    Assert.Equal(expected, Double(value));
 }
 }}}
 
-In this example, the {{{THEORY_PROVIDER}}}/{{{THEORY_PROVIDER_END}}} macros simply aid in creating a local function that returns {{{std::vector<std::tuple<int, int>>}}}, but {{{THEORY}}}s can accept //any// object that matches that signature:
+A //Theory// creates a parameterized test. Each set of parameters is bound to an instance of the test and run individually. In this example, the {{{THEORY}}} macro creates a test named {{{DoubleTest}}} which takes parameters {{{(int expected, int value)}}}. The rest of the macro's parameters are {{{std::tuples}}} whos members resolve to the same type as the test parameters.
+
+If your //Theory// data requires detailed setup (for instance, if the details of the test parameters are stored in a local database or CSV file), another macro {{{DATA_THEORY}}} creates the same sort of test, only instead of individual {{{std::tuples}}}, it takes any function object (raw function, {{{std::function}}}, functor object) that returns {{{std::vector<std::tuple>>}}}:
+
 {{{
 #!c++
 
 std::function<std::vector<std::tuple<int, int>>()> stdFn = ...;
 
 // or even a lambda! (note the parens around the lambda)
-THEORY(LambdaTheory, (int expected, int value), ([]() -> std::vector<std::tuple<int, int>>
+DATA_THEORY(LambdaTheory, (int expected, int value),
+([]() -> std::vector<std::tuple<int, int>>
 {
    std::vector<std::tuple<int, int>> data;
    data.push_back(std::make_tuple(2, 1));
 {
    Assert.Equal(expected, Double(value));
 }
-}}}
+}}}