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"
64 #include "gtest/gtest-test-part.h"
65 #include "gtest/gtest-typed-test.h"
92 // This flag controls whether Google Test catches all test-thrown exceptions
98 // to let Google Test decide.
105 // This flag causes the Google Test to list tests. None of the tests listed
109 // This flag controls whether Google Test emits a detailed XML report to a file
113 // This flags control whether Google Test prints the elapsed time for each
114 // test.
124 // This flag controls whether Google Test includes Google Test internal
141 // platforms test results are streamed to the specified port on
181 class Test;
194 // 1. Defining predicate functions to be used with Boolean test assertions
279 // Returns the text streamed into this AssertionResult. Test assertions
317 // with test assertions.
335 // In Google Test, a unit test program contains one or many TestCases, and
338 // When you define a test using the TEST macro, you don't need to
339 // explicitly derive from Test - the TEST macro automatically does
342 // The only time you derive from Test is when defining a test fixture
345 // class FooTest : public testing::Test {
355 // Test is not copyable.
356 class GTEST_API_ Test {
361 // a test case.
365 // The d'tor is virtual as we intend to inherit from Test.
366 virtual ~Test();
368 // Sets up the stuff shared by all tests in this test case.
370 // Google Test will call Foo::SetUpTestCase() before running the first
371 // test in test case Foo. Hence a sub-class can define its own
376 // Tears down the stuff shared by all tests in this test case.
378 // Google Test will call Foo::TearDownTestCase() after running the last
379 // test in test case Foo. Hence a sub-class can define its own
384 // Returns true iff the current test has a fatal failure.
387 // Returns true iff the current test has a non-fatal failure.
390 // Returns true iff the current test has a (either fatal or
394 // Logs a property for the current test. Only the last value for a given
397 // that are not members of the test fixture.
398 // The arguments are const char* instead strings, as Google Test is used
410 // Creates a Test object.
411 Test();
413 // Sets up the test fixture.
416 // Tears down the test fixture.
420 // Returns true iff the current test has the same fixture class as
421 // the first test in the current test case.
424 // Runs the test after the test fixture has been set up.
426 // A sub-class must implement this to define the test logic.
429 // Instead, use the TEST or TEST_F macro.
432 // Sets up, executes, and tears down the test.
439 // Uses a GTestFlagSaver to save and restore all Google Test flags.
443 // wondering why it is never called by Google Test. The declaration of
448 test
452 // if a user calls it from his test fixture.
462 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
467 // A copyable object representing a user specified test property which can be
502 // The result of a single Test. This includes a list of
504 // death tests there are in the Test, and how much time it took to run
505 // the Test.
516 // Gets the number of all test parts. This is the sum of the number
517 // of successful test parts and the number of failed test parts.
520 // Returns the number of the test properties.
523 // Returns true iff the test passed (i.e. no test part failed).
526 // Returns true iff the test failed.
529 // Returns true iff the test fatally failed.
532 // Returns true iff the test has a non-fatal failure.
538 // Returns the i-th test part result among all the results. i can range
543 // Returns the i-th test property. i can range from 0 to
570 // Adds a test property to the list. The property is validated and may add
577 // Adds a failure if the key is a reserved attribute of Google Test
582 // Adds a test part result to the list.
585 // Returns the death test count.
588 // Increments the death test count, returning the new count.
591 // Clears the test part results.
614 // A TestInfo object stores the following information about a test:
616 // Test case name
617 // Test name
618 // Whether the test should be run
619 // A function pointer that creates the test object when invoked
620 // Test result
631 // Returns the test case name.
634 // Returns the test name.
638 // or a type-parameterized test.
646 // is not a value-parameterized test.
653 // Returns true if this test should run, that is if the test is not disabled
657 // Google Test allows the user to filter the tests by their full names.
658 // The full name of a test Bar in test case Foo is defined as
663 // negative patterns (tests to exclude). A test is run if it
671 // Returns the result of the test.
679 friend class Test;
687 Test::SetUpTestCaseFunc set_up_tc,
688 Test::TearDownTestCaseFunc tear_down_tc,
699 // Increments the number of death tests encountered in this test so
705 // Creates the test object, runs it, records its result, and then
713 // These fields are immutable properties of the test.
714 const std::string test_case_name_; // Test case name
715 const std::string name_; // Test name
717 // type-parameterized test.
720 // value-parameterized test.
722 const internal::TypeId fixture_class_id_; // ID of the test fixture class
723 bool should_run_; // True iff this test should run
724 bool is_disabled_; // True iff this test is disabled
725 bool matches_filter_; // True if this test matches the
728 // the test object
731 // test for the second time.
737 // A test case, which consists of a vector of TestInfos.
749 // name: name of the test case
750 // a_type_param: the name of the test's type parameter, or NULL if
751 // this is not a type-parameterized test.
752 // set_up_tc: pointer to the function that sets up the test case
753 // tear_down_tc: pointer to the function that tears down the test case
755 Test::SetUpTestCaseFunc set_up_tc,
756 Test::TearDownTestCaseFunc tear_down_tc);
765 // type-parameterized test case.
772 // Returns true if any test in this test case should run.
775 // Gets the number of successful tests in this test case.
778 // Gets the number of failed tests in this test case.
781 // Gets the number of disabled tests in this test case.
784 // Get the number of tests in this test case that should run.
787 // Gets the number of all tests in this test case.
790 // Returns true iff the test case passed.
793 // Returns true iff the test case failed.
799 // Returns the i-th test among all the tests. i can range from 0 to
804 friend class Test;
815 // Returns the i-th test among all the tests. i can range from 0 to
822 // Adds a TestInfo to this test case. Will delete the TestInfo upon
826 // Clears the results of all tests in this test case.
829 // Clears the results of all tests in the given test case.
834 // Runs every test in this TestCase.
845 // Returns true iff test passed.
850 // Returns true iff test failed.
855 // Returns true iff test is disabled.
860 // Returns true if the given test should run.
865 // Shuffles the tests in this test case.
868 // Restores the test order to before the first shuffle.
871 // Name of the test case.
874 // type-parameterized test.
879 // Provides a level of indirection for the test list to allow easy
880 // shuffling and restoring the test order. The i-th element in this
881 // vector is the index of the i-th test in the shuffled test list.
883 // Pointer to the function that sets up the test case.
884 Test::SetUpTestCaseFunc set_up_tc_;
885 // Pointer to the function that tears down the test case.
886 Test::TearDownTestCaseFunc tear_down_tc_;
887 // True iff any test in this test case should run.
905 // as in some cases Google Test is used where exceptions are enabled, and
933 // Fired before any test activity starts.
948 // Fired before the test case starts.
951 // Fired before the test starts.
957 // Fired after the test ends.
960 // Fired after the test case ends.
973 // Fired after all test activities have ended.
1003 // TestEventListeners lets users add listeners to track events in Google Test.
1009 // Appends an event listener to the end of the list. Google Test assumes
1011 // the test program finishes).
1106 // Returns the working directory when the first TEST() or TEST_F()
1110 // Returns the TestCase object for the test that's currently running,
1111 // or NULL if no test is running.
1114 // Returns the TestInfo object for the test that's currently running,
1115 // or NULL if no test is running.
1118 // Returns the random seed used at the start of the current test run.
1129 // Gets the number of successful test cases.
1132 // Gets the number of failed test cases.
1135 // Gets the number of all test cases.
1138 // Gets the number of all test cases that contain at least one test
1160 // Returns true iff the unit test passed (i.e. all test cases passed).
1163 // Returns true iff the unit test failed (i.e. some test case failed
1167 // Gets the i-th test case among all the test cases. i can range from 0 to
1172 // inside Google Test.
1176 // Registers and returns a global test environment. When a test
1177 // program is run, all global test environments will be set-up in
1179 // have finished, all global test environments will be torn-down in
1188 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
1201 // Gets the i-th test case among all the test cases. i can range from 0 to
1211 friend class Test;
1227 // Google Test trace stack.
1230 // Pops a trace from the per-thread Google Test trace stack.
1247 // A convenient wrapper for adding an environment for the test
1269 // Initializes Google Test. This must be called before calling
1271 // flags that Google Test recognizes. Whenever a Google Test flag is
1274 // No value is returned. Instead, the Google Test flag variables are
1638 // A value-parameterized class must inherit from both ::testing::Test and
1640 // from ::testing::TestWithParam, but more complicated test hierarchies
1641 // may need to inherit from Test and WithParamInterface at different levels.
1643 // This interface has support for accessing the test parameter value via
1677 // The current parameter value. Is also available in the test fixture's
1680 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
1686 // remains alive and unchanged throughout the current test.
1691 // Static value used for accessing parameter during a test lifetime.
1694 // TestClass must be a subclass of WithParamInterface<T> and Test.
1705 class TestWithParam : public Test, public WithParamInterface<T> {
1710 // Macros for indicating success/failure in test code.
1712 // ADD_FAILURE unconditionally adds a failure to the current test.
1714 // current test successful, as a test is only successful when it has
1813 // When they are not, Google Test prints both the tested expressions and
1950 // Google Test uses ULP-based comparison to automatically pick a default
1994 // Macros that test for HRESULT failure and success, these are only useful
1999 // When expr unexpectedly fails or succeeds, Google Test prints the
2033 // number, and the given message) to be included in every test failure
2083 // Defines a test.
2085 // The first parameter is the name of the test case, and the second
2086 // parameter is the name of the test within the test case.
2088 // The convention is to end the test case name with "Test". For
2089 // example, a test case for the Foo class can be named FooTest.
2091 // The user should put his test code between braces after using this
2094 // TEST(FooTest, InitializesCorrectly) {
2100 // ::testing::Test>() here to get the type ID of testing::Test. This
2101 // is to work around a suspected linker bug when using Google Test as
2103 // ::testing::Test>() to return different values depending on whether
2104 // the call is from the Google Test framework itself or from user test
2106 // value, as it always calls GetTypeId<>() from the Google Test
2110 ::testing::Test, ::testing::internal::GetTestTypeId())
2112 // Define this macro to 1 to omit the definition of TEST(), which
2115 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2118 // Defines a test that uses a test fixture.
2120 // The first parameter is the name of the test fixture class, which
2121 // also doubles as the test case name. The second parameter is the
2122 // name of the test within the test case.
2124 // A test fixture class must be declared earlier. The user should put
2125 // his test code between braces after using this macro. Example:
2127 // class FooTest : public testing::Test {