Commits

Matt Oswald  committed 64b5e9c

updating the wiki

  • Participants
  • Parent commits c632dfb

Comments (0)

Files changed (2)

    return x * x;
 }
 
-
 THEORY(DoubleTest, (int expected, int value),
    std::make_tuple(2, 1),
    std::make_tuple(4, 2),
 {
    Assert.Equal(expected, Double(value));
 }
-}}}
+}}}
 
 {{{FACT}}} is a macro that takes care of registering your test with the internal test collection. The only parameter is the test name.
 
-There are other variants, {{{TIMED_FACT}}}, {{{FACT_FIXTURE}}}, and {{{TIMED_FACT_FIXTURE}}}.
-
-{{{FACT_FIXTURE}}} and {{{TIMED_FACT_FIXTURE}}} take a struct or class //fixture// type as their second argument. Your test will publicly derive from that class, and a new instance will be created for each test. Use the fixture's constructor and destructor as setup and teardown functions.
+There are several variants:
+* {{{TIMED_FACT}}} - This test will complete within a certain amount of time, or the test will be aborted and marked as a failure. The test timeout is the last parameter and should be given in milliseconds.
+* {{{UNTIMED_FACT}}} - Indicates that this is a known long-running test that is not subject to the test runner's default test timeout.
+* {{{[[UN]TIMED_]FACT_FIXTURE}}} - This macro takes a struct or class //fixture// type as their second argument. Your test will publicly derive from that class, and a new instance will be created for each test. Use the fixture's constructor and destructor as setup and teardown functions. The optional {{{TIMED_}}} and {{{UNTIMED_}}} prefixes operate as you would expect.
 
 {{{
 #!c++
 }
 }}}
 
-{{{TIMED_FACT}}} and {{{TIMED_FACT_FIXTURE}}} both take an extra parameter for test time (in milliseconds). If the test does not complete within the allotted time period, it will be aborted and the test will fail. Passing {{{-1}}} as the time limit means use the default, and is exactly equivalent to {{{FACT}}} or {{{FACT_FIXTURE}}}. Passing {{{0}}} means "no time limit", which will override the default time limit and let a known long-running test complete.
-
 {{{
 #!c++
 TIMED_FACT(ShortTest, 5)
 }
 }}}
 
-* {{{TIMED_THEORY}}} and {{{TIMED_DATA_THEORY}}} both take a timeout value in milliseconds as their last named parameters. This functions identically as it does for {{{TIMED_FACT}}}: {{{0}}} indicates there is no timeout, and {{{-1}}} means use the default.
+* Theories also have the {{{[UN]TIMED_}}} variants as well, and they operate just like the {{{FACT}}} variants.
+
+====== Test Timeouts ======
+
+A note on the test timeouts: this is inherently very fragile. Once a thread begins executing, there is no guarantee that the test will actually get //n// milliseconds of CPU time. It's possible that other tests, or even other system processes, will take control of the CPU for the majority of the time, leaving the watchdog timeout thread no choice but to assume the test thread failed to complete within the allotted time.