Merge branch 'master' into hethi/travis-unused-cmake
This commit is contained in:
commit
c780e0e2c4
@ -36,11 +36,8 @@ compiler:
|
|||||||
script: ./travis.sh
|
script: ./travis.sh
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- GTEST_TARGET=googletest SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE
|
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE=1
|
||||||
- GTEST_TARGET=googlemock SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE
|
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE=1 CXX_FLAGS=-std=c++11
|
||||||
- GTEST_TARGET=googlemock SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug CXX_FLAGS=-std=c++11 VERBOSE_MAKE=true VERBOSE
|
|
||||||
# - GTEST_TARGET=googletest SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false
|
|
||||||
# - GTEST_TARGET=googlemock SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
sudo: false
|
sudo: false
|
||||||
|
@ -26,7 +26,7 @@ in its interior [googletest/README.md](googletest/README.md) file.
|
|||||||
|
|
||||||
## Features ##
|
## Features ##
|
||||||
|
|
||||||
* An [XUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
|
* An [xUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
|
||||||
* Test discovery.
|
* Test discovery.
|
||||||
* A rich set of assertions.
|
* A rich set of assertions.
|
||||||
* User-defined assertions.
|
* User-defined assertions.
|
||||||
|
@ -148,7 +148,7 @@ Note that the mock class doesn't define `AppendPacket()`, unlike the
|
|||||||
real class. That's fine as long as the test doesn't need to call it.
|
real class. That's fine as long as the test doesn't need to call it.
|
||||||
|
|
||||||
Next, you need a way to say that you want to use
|
Next, you need a way to say that you want to use
|
||||||
`ConcretePacketStream` in production code, and use `MockPacketStream`
|
`ConcretePacketStream` in production code and to use `MockPacketStream`
|
||||||
in tests. Since the functions are not virtual and the two classes are
|
in tests. Since the functions are not virtual and the two classes are
|
||||||
unrelated, you must specify your choice at _compile time_ (as opposed
|
unrelated, you must specify your choice at _compile time_ (as opposed
|
||||||
to run time).
|
to run time).
|
||||||
@ -706,7 +706,7 @@ type `m` accepts):
|
|||||||
1. When both `T` and `U` are built-in arithmetic types (`bool`, integers, and floating-point numbers), the conversion from `T` to `U` is not lossy (in other words, any value representable by `T` can also be represented by `U`); and
|
1. When both `T` and `U` are built-in arithmetic types (`bool`, integers, and floating-point numbers), the conversion from `T` to `U` is not lossy (in other words, any value representable by `T` can also be represented by `U`); and
|
||||||
1. When `U` is a reference, `T` must also be a reference (as the underlying matcher may be interested in the address of the `U` value).
|
1. When `U` is a reference, `T` must also be a reference (as the underlying matcher may be interested in the address of the `U` value).
|
||||||
|
|
||||||
The code won't compile if any of these conditions isn't met.
|
The code won't compile if any of these conditions aren't met.
|
||||||
|
|
||||||
Here's one example:
|
Here's one example:
|
||||||
|
|
||||||
|
@ -3115,13 +3115,13 @@ TEST(DISABLED_TestCase, DISABLED_TestShouldNotRun) {
|
|||||||
FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
|
FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that when all tests in a test case are disabled, SetupTestCase() and
|
// Check that when all tests in a test case are disabled, SetUpTestCase() and
|
||||||
// TearDownTestCase() are not called.
|
// TearDownTestCase() are not called.
|
||||||
class DisabledTestsTest : public Test {
|
class DisabledTestsTest : public Test {
|
||||||
protected:
|
protected:
|
||||||
static void SetUpTestCase() {
|
static void SetUpTestCase() {
|
||||||
FAIL() << "Unexpected failure: All tests disabled in test case. "
|
FAIL() << "Unexpected failure: All tests disabled in test case. "
|
||||||
"SetupTestCase() should not be called.";
|
"SetUpTestCase() should not be called.";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TearDownTestCase() {
|
static void TearDownTestCase() {
|
||||||
|
@ -3,12 +3,11 @@ set -evx
|
|||||||
env | sort
|
env | sort
|
||||||
|
|
||||||
mkdir build || true
|
mkdir build || true
|
||||||
mkdir build/$GTEST_TARGET || true
|
cd build
|
||||||
cd build/$GTEST_TARGET
|
|
||||||
cmake -Dgtest_build_samples=ON \
|
cmake -Dgtest_build_samples=ON \
|
||||||
-Dgtest_build_tests=ON \
|
-Dgtest_build_tests=ON \
|
||||||
-Dgmock_build_tests=ON \
|
-Dgmock_build_tests=ON \
|
||||||
-DCMAKE_CXX_FLAGS=$CXX_FLAGS \
|
-DCMAKE_CXX_FLAGS=$CXX_FLAGS \
|
||||||
../../$GTEST_TARGET
|
..
|
||||||
make
|
make
|
||||||
CTEST_OUTPUT_ON_FAILURE=1 make test
|
CTEST_OUTPUT_ON_FAILURE=1 make test
|
||||||
|
Loading…
Reference in New Issue
Block a user