GTest

  • Revision slug: GTest
  • Revision title: GTest
  • Revision id: 359255
  • Created:
  • Creator: bgirard
  • Is current revision? No
  • Comment

Revision Content

(Incomplete)

GTest (googletest) is Google's framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, value- and type-parameterized tests, various options for running the tests, and XML test report generation.

Running tests

The Mozilla build process will build GTest on supported platforms if you specify 'ac_add_options --enable-gtest'. This will compile and link any GTEST_*SRCS to libxul.so. To run the unit tests specify -unittest when invoking Gecko, optionally running from a debugger.

Running selected tests

Tests can select by using the <tt>GTEST_FILTER</tt> environment variable. See Running Test Programs: Running_a_Subset_of_the_Tests for more details.

GTEST_FILTER=Moz2D.* ./firefox -unittest

Configuring GTest

GTest can be controlled from other environment variables. See Running Test Programs: Advanced Options for more details.

Writing a GTest Unit Test

 

Revision Source

<p>(Incomplete)</p>
<p>GTest (googletest) is Google's framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, value- and type-parameterized tests, various options for running the tests, and XML test report generation.</p>
<h3 id="Running_tests" name="Running_tests">Running tests</h3>
<p>The Mozilla build process will build GTest on supported platforms if you specify 'ac_add_options --enable-gtest'. This will compile and link any GTEST_*SRCS to libxul.so. To run the unit tests specify -unittest when invoking Gecko, optionally running from a debugger.</p>
<h4>Running selected tests</h4>
<p>Tests can select by using the <tt>GTEST_FILTER</tt> environment variable. See <a href="/en-US/docs/" title="/en-US/docs/">Running Test Programs: Running_a_Subset_of_the_Tests</a> for more details.</p>
<div class="note">
  <div class="syntaxbox">
    GTEST_FILTER=Moz2D.* ./firefox -unittest</div>
</div>
<h4>Configuring GTest</h4>
<p>GTest can be controlled from other environment variables. See <a href="/en-US/docs/" title="/en-US/docs/">Running Test Programs: Advanced Options</a> for more details.</p>
<h3>Writing a GTest Unit Test</h3>
<p>&nbsp;</p>
Revert to this revision