Home | History | Annotate | Download | only in gtest

Lines Matching defs:Test

32 // The Google C++ Testing Framework (Google Test)
34 // This header file defines the public API for Google Test. It should be
35 // included by any test program that uses Google Test.
47 // Acknowledgment: Google Test borrowed the idea of automatic test
59 #include <gtest/gtest-death-test.h>
61 #include <gtest/gtest-param-test.h>
63 #include <gtest/gtest-test-part.h>
64 #include <gtest/gtest-typed-test.h>
91 // This flag controls whether Google Test catches all test-thrown exceptions
97 // to let Google Test decide.
104 // This flag causes the Google Test to list tests. None of the tests listed
108 // This flag controls whether Google Test emits a detailed XML report to a file
112 // This flags control whether Google Test prints the elapsed time for each
113 // test.
123 // This flag controls whether Google Test includes Google Test internal
183 // 1. Defining predicate functions to be used with Boolean test assertions
268 // Returns the text streamed into this AssertionResult. Test assertions
293 // with test assertions.
320 // In Google Test, a unit test program contains one or many TestCases, and
323 // When you define a test using the TEST macro, you don't need to
324 // explicitly derive from Test - the TEST macro automatically does
327 // The only time you derive from Test is when defining a test fixture
330 // class FooTest : public testing::Test {
340 // Test is not copyable.
341 class GTEST_API_ Test {
346 // a test case.
350 // The d'tor is virtual as we intend to inherit from Test.
351 virtual ~Test();
353 // Sets up the stuff shared by all tests in this test case.
355 // Google Test will call Foo::SetUpTestCase() before running the first
356 // test in test case Foo. Hence a sub-class can define its own
361 // Tears down the stuff shared by all tests in this test case.
363 // Google Test will call Foo::TearDownTestCase() after running the last
364 // test in test case Foo. Hence a sub-class can define its own
369 // Returns true iff the current test has a fatal failure.
372 // Returns true iff the current test has a non-fatal failure.
375 // Returns true iff the current test has a (either fatal or
379 // Logs a property for the current test. Only the last value for a given
382 // that are not members of the test fixture.
383 // The arguments are const char* instead strings, as Google Test is used
395 // Creates a Test object.
396 Test();
398 // Sets up the test fixture.
401 // Tears down the test fixture.
405 // Returns true iff the current test has the same fixture class as
406 // the first test in the current test case.
409 // Runs the test after the test fixture has been set up.
411 // A sub-class must implement this to define the test logic.
414 // Instead, use the TEST or TEST_F macro.
417 // Sets up, executes, and tears down the test.
420 // Uses a GTestFlagSaver to save and restore all Google Test flags.
424 // wondering why it is never called by Google Test. The declaration of
429 // will be a conflict if a user declares void Setup() in his test
433 // if a user calls it from his test fixture.
443 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
448 // A copyable object representing a user specified test property which can be
483 // The result of a single Test. This includes a list of
485 // death tests there are in the Test, and how much time it took to run
486 // the Test.
497 // Gets the number of all test parts. This is the sum of the number
498 // of successful test parts and the number of failed test parts.
501 // Returns the number of the test properties.
504 // Returns true iff the test passed (i.e. no test part failed).
507 // Returns true iff the test failed.
510 // Returns true iff the test fatally failed.
513 // Returns true iff the test has a non-fatal failure.
519 // Returns the i-th test part result among all the results. i can range
524 // Returns the i-th test property. i can range from 0 to
552 // Adds a test property to the list. The property is validated and may add
559 // Adds a failure if the key is a reserved attribute of Google Test
564 // Adds a test part result to the list.
567 // Returns the death test count.
570 // Increments the death test count, returning the new count.
573 // Clears the test part results.
596 // A TestInfo object stores the following information about a test:
598 // Test case name
599 // Test name
600 // Whether the test should be run
601 // A function pointer that creates the test object when invoked
602 // Test result
613 // Returns the test case name.
616 // Returns the test name.
619 // Returns the test case comment.
622 // Returns the test comment.
625 // Returns true if this test should run, that is if the test is not disabled
629 // Google Test allows the user to filter the tests by their full names.
630 // The full name of a test Bar in test case Foo is defined as
635 // negative patterns (tests to exclude). A test is run if it
643 // Returns the result of the test.
650 friend class Test;
658 Test::SetUpTestCaseFunc set_up_tc,
659 Test::TearDownTestCaseFunc tear_down_tc,
662 // Returns true if this test matches the user-specified filter.
665 // Increments the number of death tests encountered in this test so
686 // A test case, which consists of a vector of TestInfos.
698 // name: name of the test case
699 // set_up_tc: pointer to the function that sets up the test case
700 // tear_down_tc: pointer to the function that tears down the test case
702 Test::SetUpTestCaseFunc set_up_tc,
703 Test::TearDownTestCaseFunc tear_down_tc);
711 // Returns the test case comment.
714 // Returns true if any test in this test case should run.
717 // Gets the number of successful tests in this test case.
720 // Gets the number of failed tests in this test case.
723 // Gets the number of disabled tests in this test case.
726 // Get the number of tests in this test case that should run.
729 // Gets the number of all tests in this test case.
732 // Returns true iff the test case passed.
735 // Returns true iff the test case failed.
741 // Returns the i-th test among all the tests. i can range from 0 to
746 friend class Test;
757 // Returns the i-th test among all the tests. i can range from 0 to
764 // Adds a TestInfo to this test case. Will delete the TestInfo upon
768 // Clears the results of all tests in this test case.
771 // Clears the results of all tests in the given test case.
776 // Runs every test in this TestCase.
779 // Returns true iff test passed.
782 // Returns true iff test failed.
785 // Returns true iff test is disabled.
788 // Returns true if the given test should run.
791 // Shuffles the tests in this test case.
794 // Restores the test order to before the first shuffle.
797 // Name of the test case.
799 // Comment on the test case.
804 // Provides a level of indirection for the test list to allow easy
805 // shuffling and restoring the test order. The i-th element in this
806 // vector is the index of the i-th test in the shuffled test list.
808 // Pointer to the function that sets up the test case.
809 Test::SetUpTestCaseFunc set_up_tc_;
810 // Pointer to the function that tears down the test case.
811 Test::TearDownTestCaseFunc tear_down_tc_;
812 // True iff any test in this test case should run.
830 // as in some cases Google Test is used where exceptions are enabled, and
858 // Fired before any test activity starts.
873 // Fired before the test case starts.
876 // Fired before the test starts.
882 // Fired after the test ends.
885 // Fired after the test case ends.
898 // Fired after all test activities have ended.
926 // TestEventListeners lets users add listeners to track events in Google Test.
932 // Appends an event listener to the end of the list. Google Test assumes
934 // the test program finishes).
1029 // Returns the working directory when the first TEST() or TEST_F()
1033 // Returns the TestCase object for the test that's currently running,
1034 // or NULL if no test is running.
1037 // Returns the TestInfo object for the test that's currently running,
1038 // or NULL if no test is running.
1041 // Returns the random seed used at the start of the current test run.
1052 // Gets the number of successful test cases.
1055 // Gets the number of failed test cases.
1058 // Gets the number of all test cases.
1061 // Gets the number of all test cases that contain at least one test
1083 // Returns true iff the unit test passed (i.e. all test cases passed).
1086 // Returns true iff the unit test failed (i.e. some test case failed
1090 // Gets the i-th test case among all the test cases. i can range from 0 to
1095 // inside Google Test.
1099 // Registers and returns a global test environment. When a test
1100 // program is run, all global test environments will be set-up in
1102 // have finished, all global test environments will be torn-down in
1111 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
1124 // Gets the i-th test case among all the test cases. i can range from 0 to
1134 friend class Test;
1150 // Google Test trace stack.
1153 // Pops a trace from the per-thread Google Test trace stack.
1170 // A convenient wrapper for adding an environment for the test
1192 // Initializes Google Test. This must be called before calling
1194 // flags that Google Test recognizes. Whenever a Google Test flag is
1197 // No value is returned. Instead, the Google Test flag variables are
1569 // This class adds support for accessing the test parameter value via
1598 class TestWithParam : public Test {
1602 // The current parameter value. Is also available in the test fixture's
1608 // remains alive and unchanged throughout the current test.
1613 // Static value used for accessing parameter during a test lifetime.
1625 // Macros for indicating success/failure in test code.
1627 // ADD_FAILURE unconditionally adds a failure to the current test.
1629 // current test successful, as a test is only successful when it has
1722 // When they are not, Google Test prints both the tested expressions and
1832 // Google Test uses ULP-based comparison to automatically pick a default
1876 // Macros that test for HRESULT failure and success, these are only useful
1881 // When expr unexpectedly fails or succeeds, Google Test prints the
1915 // number, and the given message) to be included in every test failure
1976 // Defines a test.
1978 // The first parameter is the name of the test case, and the second
1979 // parameter is the name of the test within the test case.
1981 // The convention is to end the test case name with "Test". For
1982 // example, a test case for the Foo class can be named FooTest.
1984 // The user should put his test code between braces after using this
1987 // TEST(FooTest, InitializesCorrectly) {
1993 // ::testing::Test>() here to get the type ID of testing::Test. This
1994 // is to work around a suspected linker bug when using Google Test as
1996 // ::testing::Test>() to return different values depending on whether
1997 // the call is from the Google Test framework itself or from user test
1999 // value, as it always calls GetTypeId<>() from the Google Test
2003 ::testing::Test, ::testing::internal::GetTestTypeId())
2005 // Define this macro to 1 to omit the definition of TEST(), which
2008 #define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2011 // Defines a test that uses a test fixture.
2013 // The first parameter is the name of the test fixture class, which
2014 // also doubles as the test case name. The second parameter is the
2015 // name of the test within the test case.
2017 // A test fixture class must be declared earlier. The user should put
2018 // his test code between braces after using this macro. Example:
2020 // class FooTest : public testing::Test {