Project derived from https://gist.github.com/butuzov/e7df782c31171f9563057871d0ae444a gist.
The scripts to install Google Test on macOS platform.
- Brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - CMake
brew install cmake
It will install gmock and gtest under brew directories.
chmod +x ./install.sh
sudo ./install.sh#include "gtest/gtest.h"
TEST( ExampleTest, First ) {
EXPECT_TRUE( true );
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}clang++ -lgtest test.cpp -o ./test -std=c++14 && ./test