diff --git a/README.md b/README.md index 157316c0..d87abce0 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ mailing list for questions, discussions, and development. There is also an IRC channel on [OFTC](https://webchat.oftc.net/) (irc.oftc.net) #gtest available. Please join us! -Getting started information for **Google Test** is available in the -[Google Test Primer](googletest/docs/Primer.md) documentation. +Getting started information for **Google Test** is available in the +[Google Test Primer](googletest/docs/primer.md) documentation. **Google Mock** is an extension to Google Test for writing and using C++ mock classes. See the separate [Google Mock documentation](googlemock/README.md). diff --git a/googlemock/README.md b/googlemock/README.md index 1170cfab..ad374dea 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -53,7 +53,7 @@ the Apache License, which is different from Google Mock's license. If you are new to the project, we suggest that you read the user documentation in the following order: - * Learn the [basics](../../master/googletest/docs/Primer.md) of + * Learn the [basics](../../master/googletest/docs/primer.md) of Google Test, if you choose to use Google Mock with it (recommended). * Read [Google Mock for Dummies](../../master/googlemock/docs/ForDummies.md). * Read the instructions below on how to build Google Mock. @@ -129,20 +129,20 @@ build Google Mock and its tests, which has further requirements: If you have CMake available, it is recommended that you follow the [build instructions][gtest_cmakebuild] -as described for Google Test. +as described for Google Test. If are using Google Mock with an existing CMake project, the section [Incorporating Into An Existing CMake Project][gtest_incorpcmake] -may be of particular interest. -To make it work for Google Mock you will need to change +may be of particular interest. +To make it work for Google Mock you will need to change target_link_libraries(example gtest_main) -to +to target_link_libraries(example gmock_main) - + This works because `gmock_main` library is compiled with Google Test. However, it does not automatically add Google Test includes. Therefore you will also have to change @@ -161,8 +161,8 @@ to "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include") endif() -This will addtionally mark Google Mock includes as system, which will -silence compiler warnings when compiling your tests using clang with +This will addtionally mark Google Mock includes as system, which will +silence compiler warnings when compiling your tests using clang with `-Wpedantic -Wall -Wextra -Wconversion`. diff --git a/googlemock/docs/CheatSheet.md b/googlemock/docs/CheatSheet.md index f8bbbfe6..d54dd16a 100644 --- a/googlemock/docs/CheatSheet.md +++ b/googlemock/docs/CheatSheet.md @@ -229,7 +229,7 @@ The `argument` can be either a C string or a C++ string object: `ContainsRegex()` and `MatchesRegex()` use the regular expression syntax defined -[here](../../googletest/docs/AdvancedGuide.md#regular-expression-syntax). +[here](../../googletest/docs/advanced.md#regular-expression-syntax). `StrCaseEq()`, `StrCaseNe()`, `StrEq()`, and `StrNe()` work for wide strings as well. @@ -349,7 +349,7 @@ You can make a matcher from one or more other matchers: ## Matchers as Test Assertions ## -|`ASSERT_THAT(expression, m)`|Generates a [fatal failure](../../googletest/docs/Primer.md#assertions) if the value of `expression` doesn't match matcher `m`.| +|`ASSERT_THAT(expression, m)`|Generates a [fatal failure](../../googletest/docs/primer.md#assertions) if the value of `expression` doesn't match matcher `m`.| |:---------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------| |`EXPECT_THAT(expression, m)`|Generates a non-fatal failure if the value of `expression` doesn't match matcher `m`. | diff --git a/googlemock/docs/CookBook.md b/googlemock/docs/CookBook.md index 3737d030..bd9f026b 100644 --- a/googlemock/docs/CookBook.md +++ b/googlemock/docs/CookBook.md @@ -3655,6 +3655,6 @@ This printer knows how to print built-in C++ types, native arrays, STL containers, and any type that supports the `<<` operator. For other types, it prints the raw bytes in the value and hopes that you the user can figure it out. -[Google Test's advanced guide](../../googletest/docs/AdvancedGuide.md#teaching-google-test-how-to-print-your-values) +[Google Test's advanced guide](../../googletest/docs/advanced.md#teaching-google-test-how-to-print-your-values) explains how to extend the printer to do a better job at printing your particular type than to dump the bytes. diff --git a/googlemock/docs/ForDummies.md b/googlemock/docs/ForDummies.md index 76910569..1e0fd416 100644 --- a/googlemock/docs/ForDummies.md +++ b/googlemock/docs/ForDummies.md @@ -187,7 +187,7 @@ sometimes causes the test program to crash. You'll still be able to notice that the test has failed, but it's not a graceful failure. A better solution is to use Google Test's -[event listener API](../../googletest/docs/AdvancedGuide.md#extending-google-test-by-handling-test-events) +[event listener API](../../googletest/docs/advanced.md#extending-google-test-by-handling-test-events) to report a test failure to your testing framework properly. You'll need to implement the `OnTestPartResult()` method of the event listener interface, but it should be straightforward. diff --git a/googlemock/docs/FrequentlyAskedQuestions.md b/googlemock/docs/FrequentlyAskedQuestions.md index ccaa3d7a..23f7da03 100644 --- a/googlemock/docs/FrequentlyAskedQuestions.md +++ b/googlemock/docs/FrequentlyAskedQuestions.md @@ -607,7 +607,6 @@ See this [recipe](CookBook.md#mocking_side_effects) for more details and an exam If you cannot find the answer to your question in this FAQ, there are some other resources you can use: - 1. read other [documentation](Documentation.md), 1. search the mailing list [archive](http://groups.google.com/group/googlemock/topics), 1. ask it on [googlemock@googlegroups.com](mailto:googlemock@googlegroups.com) and someone will answer it (to prevent spam, we require you to join the [discussion group](http://groups.google.com/group/googlemock) before you can post.). diff --git a/googletest/docs/Documentation.md b/googletest/docs/Documentation.md deleted file mode 100644 index 20f25039..00000000 --- a/googletest/docs/Documentation.md +++ /dev/null @@ -1,16 +0,0 @@ -This page lists all documentation markdown files for Google Test **(the -current git version)** --- **if you use a former version of Google Test, please read the -documentation for that specific version instead (e.g. by checking out -the respective git branch/tag).** - - * [Primer](Primer.md) -- start here if you are new to Google Test. - * [Samples](Samples.md) -- learn from examples. - * [AdvancedGuide](AdvancedGuide.md) -- learn more about Google Test. - * [XcodeGuide](XcodeGuide.md) -- how to use Google Test in Xcode on Mac. - * [Frequently-Asked Questions](FAQ.md) -- check here before asking a question on the mailing list. - -To contribute code to Google Test, read: - - * [CONTRIBUTING](../../CONTRIBUTING.md) -- read this _before_ writing your first patch. - * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files. diff --git a/googletest/docs/AdvancedGuide.md b/googletest/docs/advanced.md similarity index 99% rename from googletest/docs/AdvancedGuide.md rename to googletest/docs/advanced.md index c1a1a4ab..73b79540 100644 --- a/googletest/docs/AdvancedGuide.md +++ b/googletest/docs/advanced.md @@ -1,6 +1,6 @@ -Now that you have read [Primer](Primer.md) and learned how to write tests +Now that you have read [Primer](primer.md) and learned how to write tests using Google Test, it's time to learn some new tricks. This document will show you more assertions as well as how to construct complex failure messages, propagate fatal failures, reuse and speed up your @@ -125,7 +125,7 @@ c is 10
**Notes:** - 1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this FAQ](FAQ.md#the-compiler-complains-no-matching-function-to-call-when-i-use-assert_predn-how-do-i-fix-it) for how to resolve it. + 1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this FAQ](faq.md#the-compiler-complains-no-matching-function-to-call-when-i-use-assert_predn-how-do-i-fix-it) for how to resolve it. 1. Currently we only provide predicate assertions of arity <= 5. If you need a higher-arity assertion, let us know. _Availability_: Linux, Windows, Mac. @@ -2413,4 +2413,4 @@ file as an example on how to compile your tests against them. Congratulations! You've now learned more advanced Google Test tools and are ready to tackle more complex testing tasks. If you want to dive even deeper, you -can read the [Frequently-Asked Questions](FAQ.md). +can read the [Frequently-Asked Questions](faq.md). diff --git a/googletest/docs/FAQ.md b/googletest/docs/faq.md similarity index 97% rename from googletest/docs/FAQ.md rename to googletest/docs/faq.md index bd9526de..a886bdcc 100644 --- a/googletest/docs/FAQ.md +++ b/googletest/docs/faq.md @@ -1,7 +1,7 @@ If you cannot find the answer to your question here, and you have read -[Primer](Primer.md) and [AdvancedGuide](AdvancedGuide.md), send it to +[Primer](primer.md) and [AdvancedGuide](advanced.md), send it to googletestframework@googlegroups.com. ## Why should I use Google Test instead of my favorite C++ testing framework? ## @@ -28,11 +28,11 @@ list can help you decide whether it is for you too. * `SCOPED_TRACE` helps you understand the context of an assertion failure when it comes from inside a sub-routine or loop. * You can decide which tests to run using name patterns. This saves time when you want to quickly reproduce a test failure. * Google Test can generate XML test result reports that can be parsed by popular continuous build system like Hudson. - * Simple things are easy in Google Test, while hard things are possible: in addition to advanced features like [global test environments](AdvancedGuide.md#global-set-up-and-tear-down) and tests parameterized by [values](AdvancedGuide.md#value-parameterized-tests) or [types](docs/AdvancedGuide.md#typed-tests), Google Test supports various ways for the user to extend the framework -- if Google Test doesn't do something out of the box, chances are that a user can implement the feature using Google Test's public API, without changing Google Test itself. In particular, you can: - * expand your testing vocabulary by defining [custom predicates](AdvancedGuide.md#predicate-assertions-for-better-error-messages), - * teach Google Test how to [print your types](AdvancedGuide.md#teaching-google-test-how-to-print-your-values), - * define your own testing macros or utilities and verify them using Google Test's [Service Provider Interface](AdvancedGuide.md#catching-failures), and - * reflect on the test cases or change the test output format by intercepting the [test events](AdvancedGuide.md#extending-google-test-by-handling-test-events). + * Simple things are easy in Google Test, while hard things are possible: in addition to advanced features like [global test environments](advanced.md#global-set-up-and-tear-down) and tests parameterized by [values](advanced.md#value-parameterized-tests) or [types](docs/advanced.md#typed-tests), Google Test supports various ways for the user to extend the framework -- if Google Test doesn't do something out of the box, chances are that a user can implement the feature using Google Test's public API, without changing Google Test itself. In particular, you can: + * expand your testing vocabulary by defining [custom predicates](advanced.md#predicate-assertions-for-better-error-messages), + * teach Google Test how to [print your types](advanced.md#teaching-google-test-how-to-print-your-values), + * define your own testing macros or utilities and verify them using Google Test's [Service Provider Interface](advanced.md#catching-failures), and + * reflect on the test cases or change the test output format by intercepting the [test events](advanced.md#extending-google-test-by-handling-test-events). ## I'm getting warnings when compiling Google Test. Would you fix them? ## @@ -754,7 +754,7 @@ EXPECT_TRUE(internal::Func(12345)); ## I would like to run a test several times with different parameters. Do I need to write several similar copies of it? ## -No. You can use a feature called [value-parameterized tests](AdvancedGuide.md#Value_Parameterized_Tests) which +No. You can use a feature called [value-parameterized tests](advanced.md#Value_Parameterized_Tests) which lets you repeat your tests with different parameters, without defining it more than once. ## How do I test a file that defines main()? ## @@ -849,7 +849,7 @@ expression syntax (http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions). On Windows, it uses a limited variant of regular expression syntax. For more details, see the -[regular expression syntax](AdvancedGuide.md#Regular_Expression_Syntax). +[regular expression syntax](advanced.md#Regular_Expression_Syntax). ## I have a fixture class Foo, but TEST\_F(Foo, Bar) gives me error "no matching function for call to Foo::Foo()". Why? ## @@ -956,7 +956,7 @@ using gtest-md.vcproj instead of gtest.vcproj. ## I put my tests in a library and Google Test doesn't run them. What's happening? ## Have you read a -[warning](Primer.md#important-note-for-visual-c-users) on +[warning](primer.md#important-note-for-visual-c-users) on the Google Test Primer page? ## I want to use Google Test with Visual Studio but don't know where to start. ## diff --git a/googletest/docs/Primer.md b/googletest/docs/primer.md similarity index 98% rename from googletest/docs/Primer.md rename to googletest/docs/primer.md index 5e8ee0c6..52b99f96 100644 --- a/googletest/docs/Primer.md +++ b/googletest/docs/primer.md @@ -229,7 +229,7 @@ A `NULL` pointer and an empty string are considered _different_. _Availability_: Linux, Windows, Mac. See also: For more string comparison tricks (substring, prefix, suffix, and -regular expression matching, for example), see the [Advanced Google Test Guide](AdvancedGuide.md). +regular expression matching, for example), see the [Advanced Google Test Guide](advanced.md). # Simple Tests # @@ -290,7 +290,7 @@ To create a fixture, just: 1. Derive a class from `::testing::Test` . Start its body with `protected:` or `public:` as we'll want to access fixture members from sub-classes. 1. Inside the class, declare any objects you plan to use. 1. If necessary, write a default constructor or `SetUp()` function to prepare the objects for each test. A common mistake is to spell `SetUp()` as `Setup()` with a small `u` - don't let that happen to you. - 1. If necessary, write a destructor or `TearDown()` function to release any resources you allocated in `SetUp()` . To learn when you should use the constructor/destructor and when you should use `SetUp()/TearDown()`, read this [FAQ entry](FAQ.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function). + 1. If necessary, write a destructor or `TearDown()` function to release any resources you allocated in `SetUp()` . To learn when you should use the constructor/destructor and when you should use `SetUp()/TearDown()`, read this [FAQ entry](faq.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function). 1. If needed, define subroutines for your tests to share. When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to @@ -494,7 +494,7 @@ int main(int argc, char **argv) { The `::testing::InitGoogleTest()` function parses the command line for Google Test flags, and removes all recognized flags. This allows the user to control a -test program's behavior via various flags, which we'll cover in [AdvancedGuide](AdvancedGuide.md). +test program's behavior via various flags, which we'll cover in [AdvancedGuide](advanced.md). You must call this function before calling `RUN_ALL_TESTS()`, or the flags won't be properly initialized. @@ -522,8 +522,8 @@ There is one more pitfall, though. If you use Google Test as a static library (t # Where to Go from Here # Congratulations! You've learned the Google Test basics. You can start writing -and running Google Test tests, read some [samples](Samples.md), or continue with -[AdvancedGuide](AdvancedGuide.md), which describes many more useful Google Test features. +and running Google Test tests, read some [samples](samples.md), or continue with +[AdvancedGuide](advanced.md), which describes many more useful Google Test features. # Known Limitations # diff --git a/googletest/docs/Samples.md b/googletest/docs/samples.md similarity index 100% rename from googletest/docs/Samples.md rename to googletest/docs/samples.md diff --git a/googletest/scripts/fuse_gtest_files.py b/googletest/scripts/fuse_gtest_files.py index 9a5c8d36..d0dd464f 100755 --- a/googletest/scripts/fuse_gtest_files.py +++ b/googletest/scripts/fuse_gtest_files.py @@ -52,7 +52,7 @@ EXAMPLES This tool is experimental. In particular, it assumes that there is no conditional inclusion of Google Test headers. Please report any problems to googletestframework@googlegroups.com. You can read -https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md for +https://github.com/google/googletest/blob/master/googletest/docs/advanced.md for more information. """ diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 5406392d..3498ffe4 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -5196,7 +5196,7 @@ bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) { // each TestCase and TestInfo object. // If shard_tests == true, further filters tests based on sharding // variables in the environment - see -// https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md +// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md // . Returns the number of tests that should run. int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) { const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?